Posted in php errors
7:07 am, April 11, 2023

error Warning: getimagesize(uploads/583517f49099a.jpg): failed to open stream: No such file or directory in SimpleImage.php on line 1198

i think this error is just caused by a missing file. But there should be some kind of error checking here to not crash the whole site just due to a missing image file.

this error is quite hard to find where its actually coming from as its within a library file on another page so it does not really tell where the error is coming from. 


Warning: getimagesize(uploads/583517f49099a.jpg): failed to open stream: No such file or directory in /var/www/html/ on line 1198

Notice: Trying to access array offset on value of type bool in /var/www/html/ on line 1200

Fatal error: Uncaught Exception: Invalid image: uploads/583517f49099a.jpg in /var/www/html/ Stack trace: #0 /var/www/html/ bones\SimpleImage->get_meta_data() #1 /var/www/html/ bones\SimpleImage->load() #2 /var/www/html/ bones\SimpleImage->__construct() #3 /var/www/html/ content->also_like() #4 /var/www/html/ include('/var/www/html/c...') #5 /var/www/html/ require_once('/var/www/html/c...') #6 {main} thrown in /var/www/html/ on line 1211

I guess first ill check if the image does exist. 

Nope the image does not, but its weird that passing an invalid file crashes the whole page. 


it seems this is causing the error

content.class line 144


$img = new bones\SimpleImage($local_file);

so should just add a check for the $local_file existing before running it through simple image and that should fix it. 


					if(file_exists($local_file)) {
	                	$img = new bones\SimpleImage($local_file);
	                	$img->thumbnail(165, 165)->save($thumbnail, 70);
					} else {
						$thumbnail = "";

check if the file exists and if it does not set the thumbnail to blank or a placeholder probably. 

View Statistics
This Week
This Month
This Year

No Items Found.

Add Comment
Type in a Nick Name here
Related Search Terms
Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕


🪦 2000 - 16 Oct 2022 - Boots
Random Quote
1. Show your work to the world instead of keeping in your head💆. 2. Do the work consistently👌 3. Respect your work🥰 4. Don't postpone your work 5. Make mistakes 🔥🔥🔥
Random CSS Property


The scroll-behavior CSS property sets the behavior for a scrolling box when scrolling is triggered by the navigation or CSSOM scrolling APIs.
scroll-behavior css reference