Closed (fixed)
Project:
Image Resize Filter
Version:
6.x-1.5
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2009 at 04:37 UTC
Updated:
21 Apr 2010 at 22:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
quicksketchFrom #621536, here are two images that were used as examples:
Now works: http://a123.g.akamai.net/f/123/12465/1d/www.nationalpost.com/news/canada...
Does not work: http://www.bloomberg.com/apps/data?pid=avimage&iid=ibRQEnKp6k_U
The difference that I can see is that the Bloomberg image does not contain a "Content-Length" header, which seems to throw off PHP's getimagesize().
Comment #2
jcisio commentedIn this case, should we save the remote file first, then use getimagesize() on the local one? It works for me with the above example.
Comment #3
quicksketchThat sounds like a good solution jcisio. In truth that might offer a dramatic speed improvement because it would prevent image_resize_filter from making 2 http requests for each image. Right now we get the image size through getimagesize() on the remote image, then we retrieve and save the image again later. If we just saved the image to a temporary location before getting the image size, we might speed up the whole process quite a bit and avoid the getimagesize() problem.
Comment #4
quicksketchWell this looked like it was going to work but Bloomberg has thwarted us again. This patch makes the change suggested by jcisio (download the image first, then try to get its image size), but unfortunately Bloomberg has some kind of sniffer on incoming requests. Instead of getting the original image, I kept getting a placeholder image (see attached file). I tried imitating the headers of a browser but no matter what headers I used I still got the placeholder.
Oddly this approach also seemed to take quite a bit longer, but that might have just been the Bloomberg servers taking a long time to respond to the request.
Comment #5
quicksketchThe patch from #4 has been combined into #740724: Delete remote images from temp directory after resizing.
Unfortunately I don't think there's much we can do about Bloomberg's hot-linking protection. It's probably a violation of copyright to pull down images from such a source anyway. Image Resize Filter will not work with any image regardless of extension, but we can't fault servers for returning placeholder images if they have protections in place like this.
Comment #6
quicksketch