I'm having an issue with uploading image in the backend of a silverstripe installation running on MAMP. This looks like an error creating the thumbnail image that is displayed when you pick an image in an ImageField.
As Im running on MAMP, gd should be up and running See Here.
Is this an error with GD? Or am I setting something up wrong on my page the PortfolioItem.php file is available here
Below is the error message that I get. There is an image attached to this post showing where the error occurs.
[Warning] imagecreatefrompng() [function.imagecreatefrompng]: gd-png: fatal libpng error: IDAT: CRC error
GET /portfoliotheme/images/iframe/PortfolioItem/12/PortfolioThumbnail
Line 23 in /Applications/MAMP/htdocs/portfoliotheme/sapphire/filesystem/GD.php
Source
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 }
26
27 $this->quality = self::$default_quality;
28 parent::__construct();
29 }
Trace
* imagecreatefrompng(../assets/Uploads/thumb4.png)
Line 23 of GD.php
* GD->__construct(../assets/Uploads/thumb4.png)
Line 297 of Image.php
* Image->generateFormattedImage(CMSThumbnail,,)
Line 264 of Image.php
* Image->getFormattedImage(CMSThumbnail)
Line 211 of Image.php
* Image->CMSThumbnail()
* call_user_func_array(Array,Array)
Line 408 of ViewableData.php
* ViewableData->XML_val(CMSThumbnail,,1)
Line 56 of .cache.Applications.MAMP.htdocs.portfoliotheme.sapphire.templates.Image_iframe.ss
* include(/private/var/folders/fX/fXEdSNLgECSQjs1HvnuQik+++TI/-Tmp-/silverstripe-cache-Applications-MAMP-htdocs-portfoliotheme/.cache.Applications.MAMP.htdocs.portfoliotheme.sapphire.templates.Image_iframe.ss)
Line 357 of SSViewer.php
* SSViewer->process(ViewableData_Customised)
Line 163 of Controller.php
* Controller->handleAction(HTTPRequest)
Line 129 of RequestHandler.php
* RequestHandler->handleRequest(HTTPRequest)
Line 119 of Controller.php
* Controller->handleRequest(HTTPRequest)
Line 277 of Director.php
* Director::handleRequest(HTTPRequest,Session)
Line 121 of Director.php
* Director::direct(/images/iframe/PortfolioItem/12/PortfolioThumbnail)
Line 118 of main.php