Active
Project:
Brilliant Gallery
Version:
6.x-4.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Nov 2011 at 00:56 UTC
Updated:
21 Nov 2011 at 00:56 UTC
When I upload images with the ".jpeg" extension and display them with Brilliant Gallery, they are displayed with the "brokenimage()" image. If I simply rename the image files to the ".jpg" extension, they are displayed as expected. In the code (functions.inc and views.inc) I saw that there are some filename extension checks for ".jpg" and then "jpeg" (without the "."). Simply changing these to ".jpeg" did not solve the problem.
I like the simplicity of Brilliant Gallery, but don't have the time to debug this ".jpeg" problem. So rather than switch to something else, I put this code as a quick fix right before I call Drupal's file_save_upload():
$image_name = $_FILES['files']['name']['image'];
$image_name = str_replace(".jpeg",".jpg",$image_name);
$image_name = str_replace(".JPEG",".jpg",$image_name);
$_FILES['files']['name']['image'] = $image_name;
if ($file = file_save_upload('image', $validators, $file_path)) {
....
}