When an image is pulled in from Flickr and saved locally, the code comments say it's downloading the original size, but in my experience it doesn't. It tends to download a medium-size image from Flickr instead.

This can cause problems with image styles that expect a large image to work with.

I think the code should be changed to always use the largest available size.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein’s picture

Status: Active » Needs review
FileSize
1.57 KB

Here is a patch.

As mentioned above, the existing code comments imply that "5" is always the original size, but this isn't true. I wonder if the code dates back from a time when the Flickr API returned a smaller number of sizes than it currently does? If so, the _media_flickr_guess_size() function probably has other issue too, since it's assuming a particular mapping between image dimensions and size number.

steinmb’s picture

Issue summary: View changes

How would this work if the original is a RAW-photo? Have not read through the Flickr API yet.

steinmb’s picture

Assigned: Unassigned » steinmb

Take that back about RAW image. Found this in the FAQ:

Flickr is automatically converting them to jpg once you upload them. In other words Flickr is NOT storing your original RAW files, it is storing jpg copies. As a result, you are relying on Flickr to perform the conversion to jpg, with no control over quality or compression.

For best results, you should create jpg copies of your own images first, with all the compression/quality controls at your disposal, and then upload them to Flickr.

I'll have a look at the submitted patch.

kobb’s picture

Tested the patch.

It works for me.

Thanks @David_Rothstein

steinmb’s picture

Assigned: steinmb » Unassigned
Status: Needs review » Reviewed & tested by the community

This code addresses the problem by picking the latest value in the array. Prob. a more robust way would be to pick the nested array that is labeled 'Original', though I think this is OK for now. Cannot see that _media_flickr_guess_size() ever get the max width settings passed so we might revisit this code when addressing that problem in a separate issue. RTBC as far as I see it.

  • steinmb committed 12a2a43 on 7.x-2.x
    Issue #2066485 by David_Rothstein. Download the original (largest) size...

  • steinmb committed 496b8a3 on 7.x-1.x
    Issue #2066485 by David_Rothstein. Download the original (largest) size...
steinmb’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Assigned: Unassigned » steinmb
Status: Reviewed & tested by the community » Needs work

We should also make it into 6.x-1.x. #1480326: Images suddenly fuzzy / blurry / blurred prob. should be closed as a duplicate.

steinmb’s picture

Version: 6.x-1.x-dev » 7.x-2.x-dev
Related issues: +#1480326: Images suddenly fuzzy / blurry / blurred

6.x is outdated but we should make sure this is OK in 7.x

steinmb’s picture

Status: Needs work » Fixed

Re-tested. It is correct.

steinmb’s picture

Assigned: steinmb » Unassigned

Status: Fixed » Closed (fixed)

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