Solved

can't create thumbnails through php

Posted on 2009-04-08
4
329 Views
Last Modified: 2012-05-06
so basically i upload an image and it dynamically creates a thumbnail through php on one of my sites--it worked on one of my sites fine but i try it on another site and i get this

Warning: getimagesize(html/images/uploadTest/thumbs/2.jpg) [function.getimagesize]: failed to open stream: No such file or directory in html/admin/Thumbnail.class.php on line 174

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in html/admin/Thumbnail.class.php on line 351

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in html/admin/Thumbnail.class.php on line 359

Warning: imageinterlace(): supplied argument is not a valid Image resource in /html/admin/Thumbnail.class.php on line 327

Warning: imagejpeg(): supplied argument is not a valid Image resource in html/admin/Thumbnail.class.php on line 328

Warning: copy(tm_2.jpg) [function.copy]: failed to open stream: No such file or directory in html/admin/uploader.php on line 26

i think i changed something in the php.ini file but i'm not sure...any ideas?
Warning: getimagesize(html/images/uploadTest/thumbs/2.jpg) [function.getimagesize]: failed to open stream: No such file or directory in html/admin/Thumbnail.class.php on line 174
 
Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in html/admin/Thumbnail.class.php on line 351
 
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in html/admin/Thumbnail.class.php on line 359
 
Warning: imageinterlace(): supplied argument is not a valid Image resource in /html/admin/Thumbnail.class.php on line 327
 
Warning: imagejpeg(): supplied argument is not a valid Image resource in html/admin/Thumbnail.class.php on line 328
 
Warning: copy(tm_2.jpg) [function.copy]: failed to open stream: No such file or directory in html/admin/uploader.php on line 26

Open in new window

0
Comment
Question by:Abyssmal
4 Comments
 
LVL 14

Accepted Solution

by:
shobinsun earned 500 total points
ID: 24104142
Hello,

the warning "Warning: copy(tm_2.jpg) [function.copy]: failed to open stream: No such file or directory in html/admin/uploader.php on line 26"  means that there is no such file or the file has some permission problem. Give the full permission to the file.



To avoid these warnings, change the  'error_reporting ' variable to  error_reporting = E_ALL & ~E_NOTICE  in your php.ini file.
0
 

Author Comment

by:Abyssmal
ID: 24104388
hmm i think that makes sense, so add permissions to the folder to be able to write within the folder
0
 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 24104836
Check if the image 2.jpg exists in the referred folder. Try with some existing image in that folder.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question