Bad renaming

See all posts Reply

Bad renaming new!
by baambaam, 12 years, 2 months ago
hi
i making name like this:
$los = rand(100,999);
$nam = time() * $los;

so its always numbers but script everytime renaming my images example:
this: m_1316741187960.jpg
for this: m_zAz674zz87960.jpg

there is part of my code:
$plik_tmp = $_FILES['plik1']['tmp_name'];
if($plik_tmp!="") {
  srand();
  $los = rand(100,999);
  $name = time() * $los;
  $foo = new Upload($plik_tmp);
  if ($foo->uploaded) {
    $foo->file_auto_rename = false;
    $foo->allowed = array('image/*');
    $foo->file_overwrite = true;
    $foo->file_name_body_pre = 'd_';
    $foo->file_new_name_body   = $name;
    $foo->image_resize          = true;
    $foo->image_convert = jpg;
    $foo->image_ratio_y         = true;
    $foo->image_x               = 600;
    $foo->Process($folder);
    $foo->processed;
  }
}

any solution?Reply
Re: Bad renaming new!
by colin, 12 years, 2 months ago
Can you copy here the log when such renaming occurs?Reply
Re: Bad renaming new!
by baambaam, 12 years, 2 months ago
full log:
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.2.17
- GD version : 2.0.34
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 64M (67108864 bytes)
- language : en_GB
source is a local file /home/tmp/phpWrNCxw
- local file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
PHP exec() function is disabled
- Checking MIME type with mime.magic file (mime_content_type())
MIME type detected as image/jpeg by mime_content_type()
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : phpWrNCxw
file_src_name_body : phpWrNCxw
file_src_name_ext :
file_src_pathname : /home/tmp/phpWrNCxw
file_src_mime : image/jpeg
file_src_size : 42687 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 504
image_src_y : 407
image_src_pixels : 205128
image_src_type : jpg
image_src_bits : 8
process file to upload/2012/02/25/
- file size OK
- file mime OK : image/jpeg
- new file name ext : jpg
- new file name body : m_1284901416540
- file name safe format
- destination variables
file_dst_path : upload/2012/02/25/
file_dst_name_body : m_z28490z4z6540
file_dst_name_ext : jpg
- checking for auto_rename
- destination file details
file_dst_name : m_z28490z4z6540.jpg
file_dst_pathname : upload/2012/02/25/m_z28490z4z6540.jpg
- m_z28490z4z6540.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- resizing...
check x/y sizes
ratio_crop_x : 47 (24;23)
resized image object created
image_src_x y : 504 x 407
image_dst_x y : 247 x 200
- crop image : 0 23 0 24
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OKReply
Re: Bad renaming new!
by colin, 12 years, 2 months ago
Yes, indeed, the 1 get changed into a z, it is strange...

By any change, is your system set up with a Polish locale?

Does the problem remain if you set file_safe_name to false?Reply
Re: Bad renaming new!
by baambaam, 12 years, 2 months ago
yes Polish

file_safe_name solved my problem thx!! :)Reply