This is caused by caption width attribute based on longest side of image instead of the real width. It happens only with images in portrait orientation. See image.

Before

Comments

lolandese’s picture

Issue summary: View changes
lolandese’s picture

Status: Active » Needs review
StatusFileSize
new46.78 KB
new1.21 KB

Attached patch grabs the real width of the image instead of the longest side to use for the width of the caption. See image.

After

lolandese’s picture

StatusFileSize
new4.46 KB

Even better if the admin can change the minimum image width for which to suppress a title caption in the settings.

This way they can always use titles, even on the thumbnails, setting it to '0 px', or always suppress them setting it to '999 px'. Defaults to '100 px'.

lolandese’s picture

Title: Unnecessary white space next to image caused by caption width attribute based on longest side of image » Unnecessary white space next to image
Issue summary: View changes

Shortened issue title

lolandese’s picture

A D6 version of this is partially included in the patch posted at #688572: Photo descriptions support plus date taken, location and photographer (not yet in Flickr Fliter).

Thanks.

lolandese’s picture

Status: Needs review » Fixed
lolandese’s picture

Status: Fixed » Needs work

Extend this also to Flickr Field.

Thanks.

lolandese’s picture

Status: Needs work » Needs review
StatusFileSize
new5.35 KB

Attached patch extends to the Flickr Field submodule and corrects the default opening size that was set erroneously to 'm' in the previous patch.

lolandese’s picture

Component: flickr_filter » flickr (main module)
Status: Needs review » Fixed
lolandese’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

NOTE #5: A D6 version of this is partially included in the patch posted at #688572: Photo descriptions support plus date taken, location and photographer.

lolandese’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new4.51 KB
lolandese’s picture

lolandese’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Needs work

Pretty often we notice the following warning appearing:
warning: getimagesize(http://farm3.static.flickr.com/2040/5798582259_384e4ee239_s.jpg): failed to open stream: HTTP request failed! HTTP/1.1 504 Gateway Time-out in /home/martin/www/drupal-6/sites/all/modules/flickr/flickr.module on line 227.

The php function getimagesize() is a request that takes some unnecessary time if we already know the image is a square. We could exclude it for those. Usually those are the thumbnails that exist in potential large numbers.

Nonetheless error messages can be suppressed on production sites (D7: admin/config/development/logging, D6: /admin/settings/error-reporting) and the images show as expected, it has a performance impact. We have to say that the site cache on our test site is turned off. This problem likely won't happen if you turn it on.

Reopening to implement this performance enhancement.

lolandese’s picture

Status: Needs work » Needs review
StatusFileSize
new8.8 KB

Plus some minor README.txt edits.

lolandese’s picture

lolandese’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)
lolandese’s picture

Potentially it can be improved even further. See Super fast getimagesize in php - Stack Overflow and http://www.php.net/manual/en/function.getimagesize.php#88793.

Furthermore a recommendation has been included in the documentation (on D.O. and in README.txt):

NOTE:
For square images ('s': 75px and 'q': 150px) no real width needs to be fetched, giving it a performance advantage over other sizes. Recommended if you include many images.

lolandese’s picture

Status: Patch (to be ported) » Needs review
lolandese’s picture

StatusFileSize
new4.89 KB
lolandese’s picture

lolandese’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.