Skip to content

Conversation

@sualko
Copy link

@sualko sualko commented Feb 10, 2016

fix #488

To test this you have to add 'enable_previews' => false to your oc config. Afterwards you should be able to view all your images in the file app as usual.

Any advice how to clean this up?

@oparoz @XANi

$.getJSON(url).then(function (config) {
window.galleryFileAction.buildFeaturesList(config.features);

if (config.mediatypes.length === 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's risky, because this could happen because of some issue and might lead to misleading bug reports.

You should be able to get the value of enable_previews via OC javascript methods.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only know OC.AppConfig. What issues could occur?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick search and couldn't find anything. Maybe worth asking on IRC if there is a way to get these values in JS.
The alternative would be to add a variable to the response we send to indicate that the preview system has been disabled.
Not getting any media types can be a symptom of a bad config (php, oC, etc.) or a bug in Gallery, so if users see the thumbnails and gets the large previews, they might think that everything is working as expected.
I think it's best to detect the exact condition we want to work with.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is sufficient to detect it this way, because no thumbnails are generated. My pr only affects the file viewer, on the gallery page it still says "No pictures found".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me give you an example.
Afaik, the slideshow doesn't work on public shares using the new shorter URLs on 9.0 because the scripts are not loaded any more, so the user sees thumbnails, but clicking on them does nothing downloads them.
Let's say scripts are still loaded, but there is a defect which prevents the proper list of supported media types to be sent.
With your patch, the user would have no idea that something is broken, because he would see the thumbnails and get some kind of preview, but only for a subset of the supported media types.
So it just makes debugging a bit harder and I think this could be avoided by properly letting the frontend know that previews have been disabled.
Doing it in the config controller also has the advantage of sending the same message to the Gallery side, making it easy to print a different message or a notification to the user.

@oparoz
Copy link
Contributor

oparoz commented Feb 10, 2016

Let's get some feedback by more people.
@setnes @deMattin @arkascha @elpraga @sualko @Bugsbane @mmattel @jospoortvliet @jancborchardt

@sualko
Copy link
Author

sualko commented Feb 11, 2016

  • decide if we should use enablePreviews, enable_previews or previewsDisabled as config variable. I vote for previewsDisabled.
  • add default value for config var and documentation
  • define list of media types which should be open as full size preview. Are there any disadvantages for image/svg+xml, image/x-xbitmap or image/bmp?

@oparoz oparoz added this to the 9.1-next milestone Feb 11, 2016
@oparoz
Copy link
Contributor

oparoz commented Feb 12, 2016

decide if we should use enablePreviews, enable_previews or previewsDisabled as config variable. I vote for previewsDisabled.

I vote for previewsDisabled as well since the default behaviour is to have them enabled.

@oparoz
Copy link
Contributor

oparoz commented Feb 12, 2016

Are there any disadvantages for image/svg+xml, image/x-xbitmap or image/bmp?

Since you're using Gallery's endpoints, SVG won't work and the file will be downloaded instead of shown in the browser.
https://github.com/sualko/gallery/blob/d9c5b6a4d40ea19835e821ad842d88111ebcf543/controller/filescontroller.php#L130-L132

@PVince81
Copy link
Contributor

PVince81 commented Jul 4, 2017

closing due to lack of feedback

@PVince81 PVince81 closed this Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App stops working if enable_previews is set to false

4 participants