Images without extensions do not resize

dangrice - November 2, 2009 - 23:30
Project:Image Resize Filter
Version:6.x-1.5
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The module works okay with normal links but does not seem to work with generated characters.. IE, like the ones from news sites.

http://www.bloomberg.com/apps/data?pid=avimage&iid=ibRQEnKp6k_U
http://a123.g.akamai.net/f/123/12465/1d/www.nationalpost.com/news/canada...

If I replace the link with another image, it works fine.

Drupal 6.9.. as I haven't had a chance to up my core yet.. if it matters..

#1

quicksketch - November 2, 2009 - 23:50
Title:Generated images do not work.» Images without extensions do not resize

The problem here is that Image Resize Filter isn't able to determine what format the images are from looking at the URL. If the image were to end with png/gif/jpg it would work because Image Resize Filter knows what format to save in.

This problem should still be fixable, it'll just require a rather different approach for determining how to identify images and what to name the resized versions.

#2

dangrice - November 3, 2009 - 00:04

Hmm.

Most of the links I need lack image extensions.. alas. I wasn't even concerned as much about resizing as having a local file copied to prevent against dead links..

#3

quicksketch - November 16, 2009 - 01:41
Status:active» needs work

This patch mostly fixes the problem. When working with images without extensions, this will attempt to read the MIME-type information and create an extension from that. It works just fine for your second sample image, but not the first. I think it has to do with the Bloomberg system not setting all the necessary headers for PHP's getimagesize() function to read the image properly. The image from Akamai works great though.

I think it'd be good to commit this anyway, since it increases the number of situations that Image Resize Filter can handle, but not quite all of them.

AttachmentSize
image_resize_filter_noextension.patch 3.49 KB

#4

quicksketch - November 16, 2009 - 04:38
Status:needs work» fixed

I've committed this patch as it will make most images without extensions work. I've opened a secondary issue at #633676: Some external images without extensions do not resize to handle external images that send back improper headers (such as the Bloomberg URL).

#5

dangrice - November 19, 2009 - 07:45

Thanks!

#6

System Message - December 3, 2009 - 07:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.