Page 1 of 2

thumbnails

Posted: 20 Sep 2015 13:30
by yusef88
in latest version

Re: thumbnails

Posted: 21 Sep 2015 13:48
by admin
OK, thanks.

Re: thumbnails

Posted: 21 Sep 2015 20:53
by Slavaon
I tried the new beta version, and it does not display thumbnails of some of JPG file (photo from the phone).
In a copy dialog thumbnails work great:
thumbnails.png
thumbnails.png (65.26 KiB) Viewed 6387 times
File for experiments:
IMG_20140714_171343.zip
(689.97 KiB) Downloaded 675 times

Re: thumbnails

Posted: 21 Sep 2015 21:29
by admin
Indeed! Interesting case...

Re: thumbnails

Posted: 22 Sep 2015 01:01
by xman
Here is what makes that image different from most JPEGs around.

Every JPEG file consists of a bunch of segments, one after another. These segments start with 2 byte marker (of which first byte is always FF), followed by 2-byte value (which gives us size of these 2 bytes plus size of data to follow), followed by data (if size > 2).

Some segments don't contain size and data, just the 2-byte marker. This is the case for FF D8 (always first segment of an image), FF D9 (always the last segment of an image) and also for so-called restart markers, which I won't get into here.

Here is how the provided JPEG looks like:
FF D8 (start of image)
FF E1 (APP1 segment, contains Exif) 59 0B (size of exif data to follow, plus 2) 45 78 ... B4 47 FF D9 (exif data)
FF D9 (unknown APP5 segment) 01 FE (size of data, plus 2) FB BA .. 00 00 (data)

now we have something interesting:
FF FF FF E0 --> FF E0 is a start of an APP0 segment, but what are those FFs before that?

Those are so called fill bytes. Any marker segment may be preceded by one or more FF bytes. Or, quoting directly from JPEG specification (page 35, http://www.w3.org/Graphics/JPEG/itu-t81.pdf):
Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’.
So XY algorithm likely treats FF FF as a segment marker (wrong) and FF E0 as size (also wrong). The correct way is to skip all FF bytes until we get something other than FF FF (in our case FF E0).

If you remove those two FF bytes, image is then correctly displayed. :wink:

Re: thumbnails

Posted: 22 Sep 2015 01:22
by yusef88
isn't displaying icon for items that don't have thumbnails better than this message?

Re: thumbnails

Posted: 22 Sep 2015 09:07
by admin
yusef88 wrote:isn't displaying icon for items that don't have thumbnails better than this message?
Sure! That was a bug. It's fixed now. You might need to redo your cache to get rid of it.

Re: thumbnails

Posted: 22 Sep 2015 09:08
by admin
xman wrote:Here is what makes that image different from most JPEGs around.

Every JPEG file consists of a bunch of segments, one after another. These segments start with 2 byte marker (of which first byte is always FF), followed by 2-byte value (which gives us size of these 2 bytes plus size of data to follow), followed by data (if size > 2).

Some segments don't contain size and data, just the 2-byte marker. This is the case for FF D8 (always first segment of an image), FF D9 (always the last segment of an image) and also for so-called restart markers, which I won't get into here.

Here is how the provided JPEG looks like:
FF D8 (start of image)
FF E1 (APP1 segment, contains Exif) 59 0B (size of exif data to follow, plus 2) 45 78 ... B4 47 FF D9 (exif data)
FF D9 (unknown APP5 segment) 01 FE (size of data, plus 2) FB BA .. 00 00 (data)

now we have something interesting:
FF FF FF E0 --> FF E0 is a start of an APP0 segment, but what are those FFs before that?

Those are so called fill bytes. Any marker segment may be preceded by one or more FF bytes. Or, quoting directly from JPEG specification (page 35, http://www.w3.org/Graphics/JPEG/itu-t81.pdf):
Any marker may optionally be preceded by any number of fill bytes, which are bytes assigned code X’FF’.
So XY algorithm likely treats FF FF as a segment marker (wrong) and FF E0 as size (also wrong). The correct way is to skip all FF bytes until we get something other than FF FF (in our case FF E0).

If you remove those two FF bytes, image is then correctly displayed. :wink:
Thanks, man! I will pimp my logic...

EDIT: Bingo, it works! :tup:

Re: thumbnails

Posted: 22 Sep 2015 10:51
by yusef88
thans for fixing icons bug and here is another one after click mouse hover preview i got this mess

Re: thumbnails

Posted: 22 Sep 2015 13:04
by admin
Indeed! :shock: Fix comes, thanks!

Re: thumbnails

Posted: 01 Nov 2015 05:06
by Slavaon
I have tried the new beta and it does not correctly display thumbnails of some of JPG files (photo from the camera) in "High Speed" mode mode:
High Speed mode.jpg
High Speed mode.jpg (20.02 KiB) Viewed 6216 times
In the "Fast" mode everything correctly:
Fast mode.jpg
Fast mode.jpg (20.86 KiB) Viewed 6216 times
File for experiments: https://www.dropbox.com/s/59ee7kfo3ssdv ... 7.zip?dl=1
--------------------------------------
And yet. Now the "High Speed" mode XYplorer mode creates the thumbnails from all big file it isn't effective. For the speed of display it is necessary to look for in the file and to show the built-in thumbnails (on my picture this preview with black strips).
It is a little explanation:
For most JPEG images created by phones or digital cameras, the thumbnail image (if present) is stored in the APP1 marker (FFE1). Inside this marker segment is a TIFF file containing the EXIF information for the main image and the optional thumbnail image stored as a JPEG compressed image. The TIFF file usually contains two "pages" where the first page is the EXIF info and the second page is the thumbnail stored in the "old" TIFF type 6 format. Type 6 format is when a JPEG file is just stored as-is inside of a TIFF wrapper.
The wikipedia page on JFIF at http://en.wikipedia.org/wiki/JPEG_File_ ... nge_Format gives a good description of the JPEG Header(the header contains the thumbnail as an uncompressed raster image).
The request to add support of the built-in thumbnails for the TIFF files. As far as I know, now only Adobe Bridge works with the built-in thumbnails of TIFF, it is good if XYplorer too learns to show the built-in thumbnails for the TIFF files.

Re: thumbnails

Posted: 01 Nov 2015 09:54
by admin
I cannot reproduce the auto-rotate issue with your sample file. Works alright here in each of the quality modes. :?

Re: thumbnails

Posted: 01 Nov 2015 10:48
by Slavaon
Strange. So I launched the latest latest XYplorer BETA v15.80.0209 with the command ::fresh
There is an error:
3.gif
3.gif (187.18 KiB) Viewed 6196 times

Re: thumbnails

Posted: 01 Nov 2015 10:56
by admin
Which Windows?

Re: thumbnails

Posted: 01 Nov 2015 10:59
by Slavaon
admin wrote:Which Windows?
OS: Windows 7 Home Basic (Service Pack 1), 32-bit (6.1)
User Role: Admin
Themes: No