In development enviroment works but not in production enviroment.
Production enviroment error:
$e->getMessage():
"no decode delegate for this image format
'/tmp/sws5725c638311df5.24370631' @ error/svg.c/ReadSVGImage/2871"
Generate tmpname:
$tmpname = '/tmp/'.uniqid('sws', true);
Method:
public function load($filename)
{
try
{
$this->filename = $filename;
$this->image = new Imagick($filename);
return $this;
}
catch(ImagickException $e)
{
error_log($e->getMessage(), 3, "/tmp/log.log");
OPException::raise(new OPInvalidImageException('Could not create jpeg with ImageMagick library'));
}
}
Delegates:
convert -list configure | grep DELEGATES
bzlib djvu fftw fontconfig freetype jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
Versions (dev and prod enviroments):
- ImageMagick 6.7.7-10
- Ubuntu 14.04
- PHP 5.5.9-1ubuntu4.16
Any suggestions? Thanks for your attention.
Temporary file
In reviewing the temporary file with the command vim I got the error message coming from the server in XML format and is why the library imagick treated it as svg file.
Solution
Synchronize time operating system with the server time.
Thanks for the comments.