Announcement

  •  » Extensions
  •  » [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

#196 2022-03-16 12:41:11

tnovak
Member
2018-09-27
14

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Aderalia wrote:

The 'body { width: auto; }' part is from the plugin documentation and should probably be updates with the new code since the old one doesn't work anymore (or at least it didn't for me, maybe someone should verify that first).

You were correct again, this revision of the theme broke it. So the documentation really needs an update.
https://piwigo.org/dev/changeset?repona … styles.css

Offline

 

#197 2022-04-18 19:13:27

rajdude
Member
2021-05-18
71

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Thanks for this nice plugin!

May I ask what this does:

"Block for Panoramic Photo Page"

I tried enabling it but nothing happens. Is it looking for something in addition to checking that checkbox?

Offline

 

#198 2022-06-07 14:24:59

no_need
Member
2022-06-06
2

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Hi, thanks for the great plugin, it is exactly what I was looking for and have been using it for some time now.

I have only one problem - now I am creating derivatives (thumbnails) outside piwigo, which works perfectly for any landscape images. But all portrait images are stretched to 4:3 landscape ratio. The derivatives themselves are fine, I checked multiple times and even tried swapping the gdT generated portrait thumbnail for the "outside" generated and that made no difference. This means that the wrong aspect ratio is not related to the physical thumbnail. My idea is, that since the thumbnails are already created, then gdT never analyses the actual image and hence doesnt know if it is portrait or landscape and returns to some default value. Is this possible? Does gdT write anything to the database?

I tried looking through the code, but I have very little experience with programming, let alone css/php/js, so couldnt find anything meaningful myself. I suspect the culprint might be in some js code, which determines the correct aspect ration of the thumb, right? But why doesnt gdT use the thumbnails physical aspect ratio, but rather defualt to a "standard" value if it has not processed the image beforehand?

Any help or at least point in the right direction would be welcome.

Offline

 

#199 2022-06-07 15:10:49

tnovak
Member
2018-09-27
14

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Hi!

Just an idea, but do you see correct dimensions (height x width) on picture page?

And also did you named your derivative exactly like gdThumb?

What do you see if you let gdThumb make the thumb? Is it ok?
And then, when you swap it, still correct or wrong?
If wrong, do you see any differences between the files? Could you post here both (from some non-private example)?

Offline

 

#200 2022-06-10 15:40:32

no_need
Member
2022-06-06
2

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Hi and thanks for the really quick response and pointing me into the right direction. The dimensions are correct in a sense that the physical dimensions are right, but they do not reflect the EXIF orientation tag. An example:
- Image1 => physical=landscape, exif orientation=none; shown correctly as 2592*1728
- Image2 => physical=landscape, exif orientation=RightTop (i.e. oriented to portrait); shown "wrongly" as 2592*1728
- Image3 => physical=portrait, exif orientation=none; shown correctly as 1728*2592

So this means that piwigo and/or GDT takes only the physical dimensions of the image (not taking into account any EXIF orientation tag) and GDT then "blindly" uses this value to generate the thumbnail CSS box. This is why pregenerated derivatives are stretched for cases such as Image2. But if Piwigo generates the thumbnail itself, then it seems to analyse the picture in more depth (i.e. read the EXIF orientation) and GDT somehow reflects this. So to fix my issue I will convert all my EXIF oriented images to "physically" oriented one with something like jhead or exiftran and let you know if that solved my issue (I did it on a small sample and worked fine).

And just to answer your questions, if gdThumb generates them, they are fine. Once generated, I can substitute the "old" custom generated one and they are also shown fine. So simply swapping the thumbs has no effect (neither when initially correct, nor when stretched).

By the way, shouldnt Piwigo reflect the EXIF orientation if showing image dimensions in image details or in the database? They seem to be ignored in my case, always showing the physical picture size

Offline

 

#201 2022-06-10 19:34:18

tnovak
Member
2018-09-27
14

Re: [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Hi!

Yes, the rotation is stored in the database, in the column "rotation" in piwigo_images table.

The value is read from original image and set when writing metadata or during derivative creation.

I did some tests and it seems to be like this:

The standard values are  0,1,2,3:
0 is no rotation
2 is 180° rotation
3 is 90° clockwise rotation (for 90° counter-clockwise rotated images)
1 is 90° counter-clockwise rotation (for 90° clockwise rotated images)

So you should have set rotation 3 for your RightTop portrait oriented images.

And by this value Piwigo creates physically oriented derivatives and gdThumb creates physically oriented thumbs and css box.
So that's why your derivatives/thumbs don't work.

Recreating physically oriented derivatives/thumbs will NOT work I suppose - it would be necessary only if the image is shown wrongly rotated.
You have to set correct rotation data in image table to see correct "stretch".

(I edited the post after I found out, that exif is read right even from thumbs (where is not supposed to be), but dimensions are adjusted by the rotation data.)

Last edited by tnovak (2022-06-10 20:18:51)

Offline

 
  •  » Extensions
  •  » [Plugin] gdThumb - Masonry style thumbs in your gallery - 1.0.20

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact