owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.34k stars 2.06k forks source link

oc-1791 - TIFF files Cause errors with Picture Gallery #774

Closed msrex closed 10 years ago

msrex commented 11 years ago

From http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-1791 The reporters are still active.

If we don't support TIFF, we should at least fail graceful. Same with images that are too big.

Description: Originally thought this was an error stemming from really large images. In reality, it comes from problems caused by TIFF files.

I get the following error when a small (203k) TIFF file is in a picture gallery:

error messages
"broken image" icon in place of a thumbnail

Here is the error message I am experiencing on my install:

Notice: Undefined variable: user in /home/slmmr/public_html/oc/lib/filesystem.php on line 360

Warning: file_get_contents(/home/slmmr/public_html/oc/data/slmmr/files/home/slmmr/public_html/oc/data/slmmr/files/bigIMG test/smallTIFF.tif) function.file-get-contents: failed to open stream: No such file or directory in /home/slmmr/public_html/oc/lib/filestorage/local.php on line 79

Warning: imagecreatefromstring() function.imagecreatefromstring: Empty string or invalid image in /home/slmmr/public_html/oc/lib/image.php on line 473

The public owncloud instance at http://demo.owncloud.org/ doesn't give this error, but it does give the "broken image" icon in place of an image thumbnail.

When clicking on the icon, my installation tells me "The requested content cannot be loaded. Please try again later." while the public owncloud opens a text box with tons of gibberish.

I think we need to tell the picture gallery not to look for TIFF files. Going even further, the picture gallery probably needs to have an option about what formats to parse, in which directories, and of which sizes. I will put in feature requests for these items if they aren't there already.

Reproduction steps: put TIFF image file in folder experience symptoms described above

NOTE: this bug AFFECTS TIFF FILES OF ALL SIZES and is NOT AN BUG CAUSED BY OUT OF MEMORY (as in, the file being processed is just too big to handle... I have confirmed this by successfully including a 22MB JPEG file in a picture gallery and unsuccessfully including a 203KB TIFF file in the same gallery.

1 Comment posted by fmms Sep 19, 12:30

Are you sure this does not depend on file names?

your name seems to have a quotation mark in it ...

2 Comment posted by ER Sep 19, 12:52

Yes I'm fairly certain it's not due to filename, as I have the same problem with files named "stitch1234.tif" or similar. I will confirm later though.

3 Comment posted by ER Sep 19, 13:05

Confirmed the file name was not the problem by renaming it to remove the quotation mark.

4 Comment posted by ER Sep 19, 16:11

Further confirmed that the gallery works with a 22MB JPEG file, but has problems with a 41MB JPEG file. Although I get a different error message about being out of memory, which points to a server-side limitation.

5 Comment posted by ER Sep 19, 16:18

(sorry for all the quick 1-off updates)

Further confirmed that a 203k size TIFF breaks the gallery.

So I guess we're looking at 2 issues with the picture gallery... lack of support for TIFF (although I guess there's a chance that this is due to the way GD or imagemagick was compiled on the host) and problems with really large images (which is really a memory limit it seems).

I'm not sure where to go from here as far as is the lack of TIFF support a bug or a "feature" of the way the host-side binaries and php libs were compiled/configured or if its something inherent to owncloud, aside from testing out a small TIFF on the public testbed of owncloud (which I'm about to do right now).

7 Comment posted by Herve5

Nov 16, 09:31 I can confirm on my (different) host server I experience the same issue. (OC 4.5.1a , shared hosting at all2all.org )

BernhardPosselt commented 11 years ago

Can you check if this is fixed in the newest pictures app? cc @icewind1991

ndupless commented 11 years ago

Hi guys, I may have got late on this conversation, but I have come accross an issue regarding issues with other formats or perhaps image sizes or resolution. I have got a problematic png file which has a resolution of 1000 dpi +. Now this may seem extreme, but magazine publishers may want to store high resolution files on OC and be able to see slide shows. Your views, recommendation with regards to addressing this isue will be appreciated.

nougad commented 11 years ago

Tested with OC 5.0.8:

Following warnings when open a folder with tiff in gallery:

Warning PHP filesize(): stat failed for /var/www/owncloud/data/user/gallery/user//clientsync/folder/file.tiff at /var/www/owncloud-5.0.8/apps/gallery/lib/thumbnail.php#96  July 15, 2013 16:08
Warning PHP filemtime(): stat failed for /var/www/owncloud/data/user/gallery/user//clientsync/folder/file.tiff at /var/www/owncloud-5.0.8/apps/gallery/lib/thumbnail.php#95 July 15, 2013 16:08
Warning PHP imagecreatefromstring(): Data is not in a recognized format at /var/www/owncloud-5.0.8/lib/image.php#477    July 15, 2013 16:08

The gallery tries to display the thumbnail images but the browser doesn't show it (because not supported). When clicking on a tiff the preview window gets opened but the spinner loads forever.

cross reference to other existing bugs: https://github.com/owncloud/apps/issues/954 https://github.com/owncloud/apps/issues/708

MorrisJobke commented 11 years ago

@georgehrke Maybe have a look into that ;)

rostgaard commented 10 years ago

If I may divert the attention to the fact that a lot of TIFF files have embedded thumbnails, it may be easier to extract these instead of generating them from large images. There is a built-in function in php to handle it: http://php.net/manual/en/function.exif-thumbnail.php

DeepDiver1975 commented 10 years ago

duplicate of https://github.com/owncloud/apps/issues/954 I'm closing this one

nemo5 commented 10 years ago

still same here in 6.0.2. as far as i can see the complete folder preview is broken for folders containing .tif, e.g.: filesize(): stat failed for /var/www/owncloud/data/USER/gallery/USER//Shared/BAL/BLU/BR9B93~1 end.square.tif at /var/www/owncloud/apps/gallery/lib/thumbnail.php#98