Database tmp name?

See all posts See thread Reply

Re: Database tmp name? new!
by colin, 13 years, 6 months ago
There can be many reason. The function process() should be called only four times. Does your script output any "OK"? How many?

You need to debug the code. Add some echo ... in your code, within your loop, etc... to see why it ends up creating too many images.Reply
Re: Database tmp name?
by David, 13 years, 6 months ago
Yes it's outputting OKOKOKOK at the top when I have clicked upload.

Is this somthing to do with it?Reply
Re: Database tmp name? new!
by colin, 13 years, 6 months ago
So it means that the class has been called only 4 times, as it should.

I don't know why you have 8 images in the end. Have you tried to delete the 8 images before running the script again? How many are actually created when you run it?Reply
Re: Database tmp name? new!
by David, 13 years, 6 months ago
I get the message OKOKOKOK, then I also get 4 blocks underneath stating file uploaded with success etc...

In total its displaying 4 ok along the top and also four file uploaded with success and the image names.Reply
Re: Database tmp name? new!
by colin, 13 years, 6 months ago
So you have 4 files uploaded. There must be some old left over images in your directory maybe.Reply
Re: Database tmp name? new!
by David, 13 years, 6 months ago
I've uploaded the same image in the four upload boxes available, the folder was empty on the hosting and this is the output:

1house.jpg
1house_1.jpg
1house_2.jpg
1house_3.jpg
1house_4.jpg
1house_5.jpg
1house_6.jpg
1house_7.jpg


With only four upload slots, its managed to create 8 images?Reply
Re: Database tmp name? new!
by colin, 13 years, 6 months ago
There must be a problem in your code, or the way you call your script, etc... I cannot do much more with the information I have.

Try to add the following line, just before unset($handle);
echo $handle->log;
This will give you a lot of debugging information.Reply
Re: Database tmp name? new!
by David, 13 years, 6 months ago
This is the information it output.

OKsystem information
- class version : 0.30
- operating system : Linux
- PHP version : 5.2.14
- 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 an uploaded file
- upload OK
- 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
MIME type detected as image/jpeg by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 1house.jpg
file_src_name_body : 1house
file_src_name_ext : jpg
file_src_pathname : /tmp/phpGPAtjw
file_src_mime : image/jpeg
file_src_size : 91083 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 536
image_src_y : 309
image_src_pixels : 165624
image_src_type : jpg
image_src_bits : 8
process file to ./test/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ./test/
file_dst_name_body : 1house
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : 1house.jpg
file_dst_pathname : ./test/1house.jpg
- 1house.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
check x/y sizes
resized image object created
image_src_x y : 536 x 309
image_dst_x y : 500 x 288
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OK
OKsystem information
- class version : 0.30
- operating system : Linux
- PHP version : 5.2.14
- 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 an uploaded file
- upload OK
- 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
MIME type detected as image/jpeg by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 1house.jpg
file_src_name_body : 1house
file_src_name_ext : jpg
file_src_pathname : /tmp/php3bYALR
file_src_mime : image/jpeg
file_src_size : 91083 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 536
image_src_y : 309
image_src_pixels : 165624
image_src_type : jpg
image_src_bits : 8
process file to ./test/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ./test/
file_dst_name_body : 1house
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
auto_rename to 1house_1.jpg
- destination file details
file_dst_name : 1house_1.jpg
file_dst_pathname : ./test/1house_1.jpg
- 1house_1.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
check x/y sizes
resized image object created
image_src_x y : 536 x 309
image_dst_x y : 500 x 288
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OK
OKsystem information
- class version : 0.30
- operating system : Linux
- PHP version : 5.2.14
- 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 an uploaded file
- upload OK
- 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
MIME type detected as image/jpeg by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 1house.jpg
file_src_name_body : 1house
file_src_name_ext : jpg
file_src_pathname : /tmp/phptdE34W
file_src_mime : image/jpeg
file_src_size : 91083 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 536
image_src_y : 309
image_src_pixels : 165624
image_src_type : jpg
image_src_bits : 8
process file to ./test/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ./test/
file_dst_name_body : 1house
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
auto_rename to 1house_2.jpg
- destination file details
file_dst_name : 1house_2.jpg
file_dst_pathname : ./test/1house_2.jpg
- 1house_2.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
check x/y sizes
resized image object created
image_src_x y : 536 x 309
image_dst_x y : 500 x 288
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OK
OKsystem information
- class version : 0.30
- operating system : Linux
- PHP version : 5.2.14
- 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 an uploaded file
- upload OK
- 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
MIME type detected as image/jpeg by UNIX file() command
- MIME validated as image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 1house.jpg
file_src_name_body : 1house
file_src_name_ext : jpg
file_src_pathname : /tmp/phpxVpFaY
file_src_mime : image/jpeg
file_src_size : 91083 (max= 67108864)
file_src_error : 0
- source file is an image
image_src_x : 536
image_src_y : 309
image_src_pixels : 165624
image_src_type : jpg
image_src_bits : 8
process file to ./test/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : ./test/
file_dst_name_body : 1house
file_dst_name_ext : jpg
- image operation, keep extension
- checking for auto_rename
auto_rename to 1house_3.jpg
- destination file details
file_dst_name : 1house_3.jpg
file_dst_pathname : ./test/1house_3.jpg
- 1house_3.jpg doesn't exist already
- image resizing or conversion wanted
- source image is JPEG
- setting destination file type to jpg
- resizing...
check x/y sizes
resized image object created
image_src_x y : 536 x 309
image_dst_x y : 500 x 288
- converting...
fills in transparency with default color
- saving image...
JPEG image created
image objects destroyed
- process OK
Reply
Re: Database tmp name? new!
by colin, 19 years, 4 months ago
You must be running the script twice. As you can see in the log, it creates only four images, the last one being file_dst_pathname : ./test/1house_3.jpgReply