Questions About Readimageblob

Imagick rendering a black image

I'm trying to convert a SVG into PNG but I'm having trouuble with it.

With this link you can upload a SVG and the file will show the result: http://clound.com.br/labs/svg/export/imagick/index.php

The SVG that I'm trying to upload is this: http://clound.com.br/labs/svg/export/images/cover.svg

My code on the upload page is this:

<?php
if ( $_FILES ){
$target_path = 'output/'. basename( $_FILES['uploadedfile']['name']);
$mime = $_FILES['uploadedfile']['type'];

if ( $_FILES['uploadedfile']['error'] ){
    die( 'Error on upload.');
}

if ( move_uploaded_file( $_FILES['uploadedfile']['tmp_name'], $target_path ) ){
    echo '<embed style="border:solid 1px gray;" src="'.$target_path.'" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" /><br / >';
    
http://www.stackoverflow.com/questions/14070764/imagick-rendering-a-black-image

error converting image by imagemagick

when I try to convert via php my svg file to ex. png file i get this error:

    $filename = '507e6221c9f0f.svg';
    $content = file_get_contents($filename);
    $im = new Imagick();
    $im->readImageBlob($content);

Fatal error: Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `' @ blob.c/BlobToImage/347' in..

however when I do this via commend line everything is ok. I would use php exec() command, but I'm using PHP + IIS server, so I don't wanna to grant permission to use cmd.exe by IUSR user (the IIS user)

can anyone tell me how to fix this problem?

http://www.stackoverflow.com/questions/12950764/error-converting-image-by-imagemagick

How do I process jpg files using ImageMagick (IMagick API)? I am getting an exception, NoDecodeDelegateForThisImageFormat, whenver I try

I am using ImageMagick with the PHP IMagick API to process uploaded jpg files - however, when I try to read a Blob or even read a physical file, I get a NoDecodeDelegateForThisImageFormat exception.

An example of the code I am using is below:

private function resizeImageBlob($blob, $width, $height) {
    $image = new Imagick();
    $image->readImageBlob($blob);
    $image->resizeImage($width, $height, IMAGICK::FILTER_LANCZOS, 1);
    $resizedBlob = $image->getImageBlob();

    return $resizedBlob;
}

The image that the blob represents is a jpg image, but ImageMagick throws the exception when it tries to read the line:

$image->readImageBlob($blob);

Does anybody know why this might be happening?

http://stackoverflow.com/questions/2285161/how-do-i-process-jpg-files-using-imagemagick-imagick-api-i-am-getting-an-exception-nodecodedelegateforthisi