wrong file_dst_path

See all posts See thread Reply

Re: wrong file_dst_path new!
by colin, 8 years, 7 months ago
Can you copy here the log produced by the class? And also the code where you set up and call the class?

It should work fine on Windows, but bear in mind that I don't use Windows, and cannot guarantee full compatibility.Reply
Re: wrong file_dst_path new!
by xavier, 8 years, 7 months ago
$_FILES['img_actu'] is a simple input type file with post method.

here, my page where i call the class

header( 'content-type: text/html; charset=utf-8' );

include('class.upload.php');

$handle = new upload($_FILES['img_actu'], 'fr_FR');
if ($handle->uploaded) {
  $handle->image_convert = 'jpg';
  $handle->file_new_name_body = 'actu';
  $handle->image_resize = true;
  $handle->image_ratio_y = true;
  $handle->image_x = 300;
  $handle->process('C:/wamp/www/test_img_php/images/');
}
echo $handle->file_dst_path;
Reply
Re: wrong file_dst_path new!
by xavier, 8 years, 7 months ago
the log

system information
- class version : 0.33dev
- operating system : WINNT
- PHP version : 5.5.12
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 64M (67108864 bytes)
- language : fr_FR
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path defaults to C:\wamp\bin\php\php5.5.12/extras/magic
Fileinfo PECL extension failed (finfo_open)
- Checking MIME type with UNIX file() command
UNIX file() command not availabled
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as image/png by mime_content_type()
- MIME validated as image/png
source variables
- You can use all these before calling process()
file_src_name : a11.png
file_src_name_body : a11
file_src_name_ext : png
file_src_pathname : C:\wamp\tmp\php3121.tmp
file_src_mime : image/png
file_src_size : 39539 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 481
image_src_y : 32
image_src_pixels : 15392
image_src_type : png
image_src_bits : 8
process file to C:/wamp/www/test_img_php/images/\
- file size OK
- file mime OK : image/png
- new file name ext : jpg
- new file name body : actu
- file name safe format
- destination variables
file_dst_path : C:/wamp/www/test_img_php/images/\
file_dst_name_body : actu
file_dst_name_ext : jpg
- checking for auto_rename
auto_rename to actu_1.jpg
- destination file details
file_dst_name : actu_1.jpg
file_dst_pathname : C:/wamp/www/test_img_php/images/\actu_1.jpg
- actu_1.jpg doesn't exist already
- image resizing or conversion wanted
- source image is PNG
- resizing...
calculate y size
resized image object created
image_src_x y : 481 x 32
image_dst_x y : 300 x 20
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OK
Reply
Re: wrong file_dst_path new!
by colin, 8 years, 7 months ago
I am not too familiar with Windows, but shouldn't your path be with anti-slashes?
C:\wamp\www\test_img_php\images\Reply
Re: wrong file_dst_path new!
by xavier, 8 years, 7 months ago
Normaly i use slash and it works fine. But here, it seems to be ok with anti-slash and the class works fine. Thanks.Reply