Icar Gongora
Icar Gongora

Reputation: 53

ImageMagick File is too Big

I'm working with imagemagick to convert images from .tiff to .jpeg and make its thumbanils. The converstion from .tiff into .jpeg is OK but the problem comes when I want use imagemagick to move to other folders with others resolutions and creating its thumbnails. Imagemagick says that image in $path.$destinationPath.$ref.".jpeg" is too big but that image doesn't exist...

-Here it is my code:

exec("/usr/bin/convert ".$tiffPath.$ref.".tiff  ".$CommonPath.$sourcePath.$ref.".jpeg");

// Ok until here

if (!file_exists($CommonPath.$destinationPath.$ref.".jpeg"))
{
    $executa = "/usr/bin/convert -size 800x800 ".$CommonPath.$sourcePath.$ref.".jpeg -thumbnail 800x800 ".$path.$destinationPath.$ref.".jpeg";

    exec($executa);
}

Imagemagick returns the following:

convert: unable to open image $CommonPath.$destinationPath.$ref.".jpeg": File is too big @ error/blob.c/OpenBlob/2589.

Thanks in advance!

Upvotes: 0

Views: 718

Answers (1)

fmw42
fmw42

Reputation: 53081

Your second ImageMagick command is malformed. You have:

$executa = "/usr/bin/convert -size 800x800 ".$CommonPath.$sourcePath.$ref.".jpeg -thumbnail 800x800 ".$path.$destinationPath.$ref.".jpeg";


The -size 800x800 is for creating a new image via xc: or canvas:. It may be confusing the command line to think you have two input images. It is certainly not needed. Try removing it, such as

$executa = "/usr/bin/convert ".$CommonPath.$sourcePath.$ref.".jpeg -thumbnail 800x800 ".$path.$destinationPath.$ref.".jpeg";

Upvotes: 1

Related Questions