Closed (fixed)
Project:
PhotoSwipe - Responsive JavaScript Modal Image Gallery
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2016 at 21:37 UTC
Updated:
10 Apr 2019 at 17:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
ParisLiakos commentedprobably because the data-size attribute is wrong..can you paste the generated markup of the link+image?
Comment #3
tobias-hd commentedLooks like you are right, with the wrong data-size attribute:
PS: Uploaded the corresponding image (DSC_1515.JPG).
Comment #4
tobias-hd commentedComment #5
kay.beissert commentedSame problem here, but my portrait images get stretched to landscape-format. The data-size-attribute is filled with the wrong image-size-values. How can this behaviour be solved.
Thanks
Comment #6
kay.beissert commentedAfter some fiddling with the "photoswipe.theme.inc" it seems, the item has no width- and height-value. So I load the image-file from the $uri first to get the height- and with-value. With these values I can define the dimension-array. I got this code from elsewhere on the internet and hey, I'am no coder, so this could be done nicer ;)
From line 44
Comment #7
adamwhite commentedI was seeing the same problems and the change suggested in #6 worked for me. Here's that modification as a patch:
Comment #8
iamdroid commented#7 works for me. Thank you.
Comment #9
segovia94 commentedThis problem is likely due to the core bug https://www.drupal.org/node/2644468 that incorrectly saves the width and height data from the first of multiple image uploads for all subsequent photos. It doesn't happen if you upload one photo at a time, but if you upload several in one batch then the first images dimensions are used for all.
This patch to core fixed the root issue. https://www.drupal.org/node/2644468#comment-11625775
Comment #10
Anonymous (not verified) commented#7 works . Thanks.
Comment #11
Tom83 commented#7 works. Drupal 8.2.8 & Photoswipe 8.x-1.0-beta3
Comment #12
drupalfan2 commented#7 worked for me. Thank you.
Comment #13
drupalfan2 commentedWhen will this patch be committed to beta4 version?
Comment #14
anybodyCould you please retry the latest dev and re-roll the patch against it, if the issue is not fixed there yet?
Thanks!
Comment #15
tobias-hd commentedThanks for working on this. Unfortunately I have no drupal installation running anymore to verify the fix, and for private reasons I currently don't have time to set one up again. Sorry!
Comment #16
anybodyOkay, thanks tobias-hd. Perhaps one of the others here will have a look / test and reroll the patch if still required.
Comment #18
sashken2 commentedPatch #7 works good with Photoswipe 8.x-1.0-beta4
Photoswipe 8.x-1.0-beta5 not working on my site.
Comment #19
anybodyHi sashken2,
is beta5 not working at all on your site or not with the patch? The patch surely needs a reroll to apply.
Comment #20
sashken2 commentedHi Anybody,
beta5 not working at all on my site. After downgrade to beta4 all works good
Comment #21
anybodyCould you please open a new issue for that and describe what doesn't work? Is the library included correctly (JS Console), do you set classes manually, ...
The patch from this issue should get a new reroll against dev.
Comment #22
iamdroid commentedClean beta5 works and this bug also appear.
I rerolled #7 for beta5. And then bug left again.
Comment #23
anybodyComment #24
anybodyHi and thank you very much.
Plese also correct the if condition:
This should check for !empty() image_width and image_height. Roll the patch against dev. I think we can commit it to dev then, if we get some more reviews for the latest patch.
Thank you.
Comment #25
iamdroid commentedYeah, you right. I just rerolled patch and even don't check that condition is wrong.
Here is an updated patch.
Comment #26
anybodyPushed to dev. Please test. This will be part of the next stable release one day :)
Comment #28
FO commentedHi,
I've always the same bug with the last dev.
Comment #29
anybody@FO: Did one of the patches / solutions posted above work for you? This is definitly in latest 8.x dev. You're using Drupal 8, right?
If you can find out the reason for the problems or write a test patch we can reopen this.
Comment #30
FO commentedYes, I'm using Drupal 8.5.5 with the last dev of Photoswipe
In my composer.json file :
But I'm using blazy_photoswipe for my gallery :
http://abconcept.ch/fr/galerie
Comment #31
anybodyComment #32
anybodyI'm not going to work on this bug in the near future. If paid development is wanted, please contact me. Otherwise I'll review / commit patches from others. Thank you.
Comment #33
FO commentedOk ! Thanks !
Comment #34
kingjimza commentedHi Guys,
I had this issue as well and seem to have found a module that clears the "incorrect aspect ratio" issue.
I am running;
After two full days of trying to get this work, I read #9 and followed links.
At the very bottom; #94 there is a link to a module;
See; Image Field Repair
I installed and ran the module (admin/config/media/image_file_repair/dimensions), It all works now :)
Seems it was more of a Drupal core issue than a Photoswipe issue.
Cheers and let us know if this works for you.
Comment #35
anybody@FO & @kingjimza: Please retest the latest 8.x-2.x-dev after #3021740: Play nice with Blazy, Slick has been commited. 8.x-1.x will not be maintained by me anymore.
Comment #36
anybodySetting this fixed again.
Comment #37
anybody