Donations accepted

Hosted on verot.net

file name changed

See all posts Reply

file name changed new!
by Raul, 6 years, 11 months ago
Hello. First i would like to congratulate...

I have created a zip with few images within and made a code to extract them and resizing with this class...
Everything work fine resizing and copying files, but image_converter not changing File Extension of the files after first save. All files are saved in right type but Files Extension after first save are wrong(keeping orginal File extension)...
Thank you in advance.Reply
Re: file name changed new!
by colin, 6 years, 11 months ago
Can you print out the log of the class after calling Process(), and paste it here?

For instance:
...
$handle->process('/dest/dir/');
echo $handle->log;
...
$handle->process('/dest/dir/');
echo $handle->log;

And by the way, it is image_convert, not image_converter.Reply
Re: file name changed new!
by raul, 6 years, 11 months ago
source is a local file upload/szoln1.jpg
- local file name OK
- source variables
file_src_name : szoln1.jpg
file_src_name_body : szoln1
file_src_name_ext : jpg
file_src_pathname : upload/szoln1.jpg
file_src_mime : image/jpeg
file_src_size : 79280 (max= 41943040)
file_src_error : 0
process file to gallery/thumb/\
- file size OK
- file mime OK : image/jpeg
- new file name body : gif
- file name safe format
- destination variables
file_dst_path : gallery/thumb/\
file_dst_name_body : gif
file_dst_name_ext : jpg
- image operation, change extension for conversion type
- checking for auto_rename
auto_rename to gif_8.jpg
- destination file details
file_dst_name : gif_8.jpg
file_dst_pathname : gallery/thumb/\gif_8.jpg
- gif_8.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- resizing...
check x/y sizes
ratio_crop_y : 13 (7;6)
resized image object created
image_src_x y : 567 x 640
image_dst_x y : 69 x 77
- crop image : 7 0 6 0
- converting..
GIF image created
image objects destroyed
- process OK
process file to gallery/thumb/\
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : gallery/thumb/\
file_dst_name_body : szoln1
file_dst_name_ext : jpg
- no image operation, keep extension
- checking for auto_rename
auto_rename to szoln1_1.jpg
- destination file details
file_dst_name : szoln1_1.jpg
file_dst_pathname : gallery/thumb/\szoln1_1.jpg
- szoln1_1.jpg doesn't exist already
- no image processing wanted
- process OK
source is a local file upload/szoln10.jpg
- local file name OK
- source variables
file_src_name : szoln10.jpg
file_src_name_body : szoln10
file_src_name_ext : jpg
file_src_pathname : upload/szoln10.jpg
file_src_mime : image/jpeg
file_src_size : 120130 (max= 41943040)
file_src_error : 0
process file to gallery/thumb/\
- file size OK
- file mime OK : image/jpeg
- new file name body : gif
- file name safe format
- destination variables
file_dst_path : gallery/thumb/\
file_dst_name_body : gif
file_dst_name_ext : jpg
- image operation, change extension for conversion type
- checking for auto_rename
auto_rename to gif_9.jpg
- destination file details
file_dst_name : gif_9.jpg
file_dst_pathname : gallery/thumb/\gif_9.jpg
- gif_9.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- resizing...
check x/y sizes
ratio_crop_y : 0 (0;0)
resized image object created
image_src_x y : 640 x 594
image_dst_x y : 69 x 64
- crop image : 0 0 0 0
- converting..
GIF image created
image objects destroyed
- process OK
process file to gallery/thumb/\
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : gallery/thumb/\
file_dst_name_body : szoln10
file_dst_name_ext : jpg
- no image operation, keep extension
- checking for auto_rename
auto_rename to szoln10_1.jpg
- destination file details
file_dst_name : szoln10_1.jpg
file_dst_pathname : gallery/thumb/\szoln10_1.jpg
- szoln10_1.jpg doesn't exist already
- no image processing wanted
- process OK
Reply
Re: file name changed new!
by raul, 6 years, 11 months ago
Now i see the solution:
$handle->file_new_name_ext = 'gif';

Thank you for help.Reply