Solved

can't create thumbnails through php

Posted on 2009-04-08
4
328 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 count occurrences of each item in an array.

803 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