symphonycms / jit_image_manipulation

Just in Time Image Manipulation for Symphony CMS
http://symphonyextensions.com/extensions/jit_image_manipulation/
Other
25 stars 42 forks source link

JIT expects a file suffix for images #75

Closed michael-e closed 10 years ago

michael-e commented 11 years ago

I wondered why JIT's rewrite rule expects a file suffix for (internal and external) images:

RewriteRule ^image\/(.+\.(jpg|gif|jpeg|png|bmp))$ extensions/jit_image_manipulation/lib/image.php?param=$1 [B,L,NC]

On the web, there might be a lot of (e.g. auto-generated) images without any suffix. (Actually I had an issue with a Twitter profile image which had no suffix.) So what about simplifying the rewrite, like so:

RewriteRule ^image\/(.+)$ extensions/jit_image_manipulation/lib/image.php?param=$1 [B,L,NC]

Please don't anybody say that this is a security feature. Think twice, it is not. :-)

DavidOliver commented 11 years ago

+1 for this simplification.

andrewminton commented 10 years ago

The above alteration is giving me errors in 2.4 integration with attempting to grab external images from a vimeo video url.

No meta is returned and therefore the check for image type skips JPEG https://github.com/symphonycms/jit_image_manipulation/blob/integration/lib/class.image.php#L101

And goes straight to : https://github.com/symphonycms/jit_image_manipulation/blob/integration/lib/class.image.php#L117

By adding the original regex back into the htaccess my cached file returns.