gobbledegook / creevey

Phoenix Slides
174 stars 25 forks source link

size of thumbnails too small for some JPG (since v1.5.4) #37

Closed WolfgangFranke closed 5 months ago

WolfgangFranke commented 5 months ago

In thumbnails view, the thumbnails size of some JPG are not scaling up to the usual size anymore. Since v1.5.4. , some JPGs thumbnails are shown significantly smaller than for other JPGs. The more I crop this odd kind of photo, the smaller the thumbnail gets shown. See attached Screenshots. This issue was introduced in v1.5.4, the v1.5.3 works fine.

The photo JPGs I tested in the screenshot below are from a Scanner with 5.000x3.000 Pixel. But most other photo JPGs work well (e.g. from iPhone) and show the same full thumbnail size in 1.5.3 and 1.5.4.

WolfgangFranke commented 5 months ago

Compare v153 - v154

WolfgangFranke commented 5 months ago

The left 2 ok-photos are taken by my iPhone: 1 full size (4.000x3.000 Pixel) and 1 cropped (2.000x1.500 Pixel) , both JPGs have same thumbnail size, correct. The right 2 wrong-photos are scanned: 1 full size (5.100x3.300 Pixel) and 1 cropped details (2.800x2.200 Pixel) , the Thumbnails of both wrong-type JPGs do not scale to the size they should.

Bildschirmfoto 2024-02-06 um 22 02 12

gobbledegook commented 5 months ago

What is your setting for Maximum Thumbnail Size in your preferences?

WolfgangFranke commented 5 months ago

Thanks Dominic, that was the root issue. Setting the preferences "Maximum Thumbnail Size" to 512 did help. I'm not sure if versions from 1.5.4 ignore the 1.5.3 preference "Maximum Thumbnail Size" and set it to 160, or why it worked before. Thanks, I close this issue.

gobbledegook commented 5 months ago

Actually I'm trying to find out if setting the preference to 160 or 320 brings the problem back... if it does then it's a bug I need to fix!

WolfgangFranke commented 5 months ago

Setting the preference from 512 to 160 brings the problem back, but from 512 to 320 no problem occurs. The behavior is different:

I hope that helps you to decide of you need to reopen the issue.

gobbledegook commented 5 months ago

Could you attach one of the "wrong" images? Either your scanner is generating tiny thumbnails or Phoenix Slides is interpreting the data wrong.

WolfgangFranke commented 5 months ago

Hi Dominic, I file-transferred a "wrong" scanned image by e-mail to you, the file size is >10MB and too big to upload here.

gobbledegook commented 5 months ago

Looks like your scanner is creating jpegs with bizarrely sized embedded thumbnails (101x67). I've made a patch to check for this circumstance and create a new thumbnail in such cases:

~blyt.net/phxslides/phoenix-slides-156d1.dmg~

gobbledegook commented 5 months ago

To explain more: when you set the thumbnail size preference to 160 pixels, Phoenix Slides tries to optimize by using the embedded thumbnail in jpegs, which is supposed to be 160x120. If you set that preference to 320/512, thumbnails are always generated from jpegs (instead of extracted from the file when present). I made the change so it also generates thumbnails if it finds an embedded thumbnail that's too small.

WolfgangFranke commented 5 months ago

I confirm phoenix-slides-156d1 works as expected also with the odd photos when thumbnail size preference is 160 pixels. Thank you for describing how the 160 pixels versus 320/512 pixels setting works, this explains it nicely.