Ticket #590 (closed Bug: fixed)

Opened 4 months ago

Last modified 3 months ago

Image library process() sees upper or mixed case extensions as invalid

Reported by: rick Owned by: - No owner -
Priority: minor Milestone: 2.1.2
Component: Libraries:Image Version: SVN HEAD
Keywords: image file extension case uppercase lowercase Cc:

Description

The Image library won't allow mixed or upper case image file extensions when saving. The upload helper, on the other hand, doesn't care about case so there is an inconsistency when using the upload::type() method for validation in combination with uploading images. Here is a possible simple fix for the GD driver:

// line 50 of system/libraries/drivers/Image/GD.php
switch (substr($file, strrpos($file, '.') + 1))
// change to 
switch (strtolower(substr($file, strrpos($file, '.') + 1)))

I haven't looked at the ImageMagick? driver.

Then there is a question of whether mixed case image extensions should be allowed. Maybe the image library could normalize all extensions to lower case.

Change History

Changed 4 months ago by tterragcnoom

The ImageMagick? driver shouldn't need any changes, ImageMagick? detects the type of file on it's own.

Changed 3 months ago by Shadowhand

  • keywords image file extension case uppercase lowercase added
  • status changed from new to closed
  • resolution set to fixed

Fixed in r2709, merged in r2711.

Note: See TracTickets for help on using tickets.