Part of the EllisLab Network
   
 
Bug with Image_lib.php - images with new_image set with full path produce bad dest path
Posted: 04 July 2009 03:14 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  7
Joined  07-04-2009

Sorry, poorly written subject. This is the problem:

http://codeigniter.com/forums/viewthread/119945/

This looks like a bug in Image_lib.php (v1.7.1)

The documentation says you can enter a full path and file name for the config option “new_image”.

In my case Image_lib.php is failing on line 1216 where imagejpeg() is trying to use the value of $full_dst_path. Where my values fed into the resize method were for example:

$config[‘source_image’] = “path/to/source/image/source_name.jpg”;
$config[‘new_image’] = “different/path/to/new/image/new_name.jpg

The value of $full_dst_path was being put together (on line 264) as

different/path/to/new/image/new_name/source_name.jpg

using the following:

$this->full_dst_path = $this->dest_folder.$filename.$this->thumb_marker.$file_ext;

Profile
 
 
Posted: 04 July 2009 04:03 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Avatar
Total Posts:  7
Joined  07-04-2009

This is mostly invalid. I have found the problem in my case, my new filenames did not include the file extensions (they are generated from the original file name plus a timestamp, and as a left-over from an old script, did not have the extensions reattached to the name). Image_lib.php was assuming the value of new_image was a directory, despite the lack of a trailing slash.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120515 Total Logged-in Users: 32
Total Topics: 126587 Total Anonymous Users: 3
Total Replies: 665484 Total Guests: 403
Total Posts: 792071    
Members ( View Memberlist )
Newest Members:  harry29512sarah123CasERispukgendaleOptimizaiofficeiEclipsekinkadebbbBenAbrams