Closed (fixed)
Project:
Feeds Image Grabber
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Reporter:
Created:
14 Aug 2010 at 09:39 UTC
Updated:
3 Sep 2010 at 18:20 UTC
This one took at least 2 hours to find.. Augh..
feeds_imagegrabber_validate_download_size returns -1 for any image that doesn't have $result->headers['Content-Length']; set. This is all fine and dandy, but all my images from a particular server were coming up gone! After an hour of searching, I noticed.. $result->headers['Content-length']; See it? it's the lowercase "l" in "length"!
You could force the keys for headers to be all lowercase, and only check for the lower version .. or even only do it locally with array_change_key_case (though I'm not sure if that's safe on multi dimensional arrays).
Comments
Comment #1
publicmind commentedI do not see any problem with converting keys to LOWER CASE but even the Drupal API (drupal_http_request) uses CASE SENSITIVE keys for Location, User-Agent, etc. So I am a little apprehensive about the proposed solution. Also, some servers do not even send the 'Content-Length' key.
The design of
feeds_imagegrabber_scrape_imagesallows you to bypass the validation of image size ($option['getsize'] = FALSE) but you can not set it through the interface yet. Also, you won't be able to compare the scraped images based on their sizes.Cheers,
Comment #2
techninja commentedThanks.. Here's hoping that comes in eventually, not that removing getsize is a perfect fix.
Considering dealing with external feeds means dealing with "other people's servers" it wouldn't be such a nasty hack to add in some options to get around common issues. Of course, I have no idea if the the latter, or #882968: Certain feeds URLs redirect to their doom? are common issues. In the mean time I guess I'll be keeping my own version. Thanks again for the quick response.
Cheers--
Comment #3
publicmind commentedIt should now be fixed in dev. Please test it and let me know.
Thanks,