Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

[UPDATED] Getimagesize error in GD.php


Go to End


4 Posts   3037 Views

Avatar
Ryan M.

Community Member, 309 Posts

28 May 2010 at 1:17pm

Edited: 05/07/2010 12:30pm

Anybody have a clue what could be causing this error? I get it while trying to visit my videos page.

[Notice] getimagesize() [function.getimagesize]: Read error!
GET /videos/

Line 19 in /var/www/vhosts/domain.com/subdomains/subsite/httpdocs/sapphire/filesystem/GD.php

Source

10 	
11 	protected static $default_quality = 75;
12 	
13 	function __construct($filename = null) {
14 		// If we're working with image resampling, things could take a while.  Bump up the time-limit
15 		increase_time_limit_to(300);
16 
17 		if($filename) {
18 			// We use getimagesize instead of extension checking, because sometimes extensions are wrong.
19 			list($width, $height, $type, $attr) = getimagesize($filename);
20 			switch($type) {
21 				case 1: if(function_exists('imagecreatefromgif')) $this->setGD(imagecreatefromgif($filename)); break;
22 				case 2: if(function_exists('imagecreatefromjpeg')) $this->setGD(imagecreatefromjpeg($filename)); break;
23 				case 3: if(function_exists('imagecreatefrompng')) $this->setGD(imagecreatefrompng($filename)); break;
24 			}
25 		}
Trace

getimagesize(../assets/video_thumbnails/sswcutout20100508043506aia171n43w8620100508043505m.jpg) 
Line 19 of GD.php
GD->__construct(../assets/video_thumbnails/sswcutout20100508043506aia171n43w8620100508043505m.jpg) 
Line 297 of Image.php
Image->generateFormattedImage(croppedimage,158,124) 
Line 264 of Image.php
Image->getFormattedImage(croppedimage,158,124) 
call_user_func_array(Array,Array) 
Line 565 of Object.php
Object->__call(CroppedImage,Array) 
Image->CroppedImage(158,124) 
call_user_func_array(Array,Array) 
Line 408 of ViewableData.php
ViewableData->XML_val(CroppedImage,Array,1) 
Line 69 of .cache.var.www.vhosts.domain.com.subdomains.subsite.httpdocs.themes.theme.templates.Layout.VideoGallery.ss
include(/tmp/silverstripe-cache-var-www-vhosts-domain.com-subdomains-subsite-httpdocs/.cache.var.www.vhosts.domain.com.subdomains.subsite.httpdocs.themes.theme.templates.Layout.VideoGallery.ss) 
Line 357 of SSViewer.php
SSViewer->process(VideoGallery_Controller) 
Line 349 of SSViewer.php
SSViewer->process(VideoGallery_Controller) 
Line 172 of Controller.php
Controller->handleAction(HTTPRequest) 
Line 129 of RequestHandler.php
RequestHandler->handleRequest(HTTPRequest) 
Line 119 of Controller.php
Controller->handleRequest(HTTPRequest) 
Line 29 of ModelAsController.php
ModelAsController->handleRequest(HTTPRequest) 
Line 280 of Director.php
Director::handleRequest(HTTPRequest,Session) 
Line 121 of Director.php
Director::direct(/videos/) 
Line 118 of main.php

I checked, file and dir perms are OK. The generated thumb image is saved to the assets directory OK. What gives???

[SOLVED]:

No idea how it got fixed. It just started working... If anybody has any insight into this error in order to prevent it again in the future, much appreciated!

Avatar
Ryan M.

Community Member, 309 Posts

5 July 2010 at 12:32pm

Reopening this thread and wanted to provide further insight.

Ran into the problem again and narrowed it down to something odd in the system. Not sure if this is helpful info at all but it's worth looking into and asking around about.

I get this error when I upload a MPG video file. Any other format like wmv or mp4 or avi work just fine. It's just uploading a MPG file and generating its thumbnail that trips the system up and throws the error posted about above.

Can anybody provide some insight into this?

Avatar
stevanovich

Community Member, 63 Posts

9 December 2011 at 10:32am

Reopening this thread.....Can't provide any insight but would like to know why this is still happen a la 2011 dec.

Okay I have tested a number of codec including mov mpg etc the one that will not work with me is .flv and some older movies.

Anyone have any bright ideas as to why this is happening

Avatar
stevanovich

Community Member, 63 Posts

9 December 2011 at 10:45am

Update!!!! again have been messing with codecs and can upload flv when created from something which I managed to upload. I am starting to think it is old movie quirks, which may be the problem. Updating using other software maybe the way forward although this defeats the object of ffmpeg.....Oh well