This works for me on my Godaddy server account
<?php
$IM_list=shell_exec("/usr/local/bin/convert -list");
echo $IM_list
?>
as do these
<?php
system("/usr/local/bin/convert -list");
?>
<?php
exec("/usr/local/bin/convert -list",$out,$returnval);
print_r($out);
?>
unexpected result of image flattening - doubling the width..
Re: unexpected result of image flattening - doubling the width..
Thanks - handy options.
As I said all other lists were working fine with my old verbose info method - it was only when there was no extra option between -list and -verbose that it didn't like it..
but I am sure the options you have offered are cleaner and more flexible for ALL ..ta
As I said all other lists were working fine with my old verbose info method - it was only when there was no extra option between -list and -verbose that it didn't like it..
but I am sure the options you have offered are cleaner and more flexible for ALL ..ta
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: unexpected result of image flattening - doubling the width..
IM usually does not add IM specific information to an image. But in the case of PNG, it does.tobycarr wrote:Great! Thank you very much - works nicely. SO does that mean a png file created with IM carries some IM-based info like virtual canvas dimensions, or is that standard for pngs? Excuse my ignorance..
PNG images by default can include a page offset. Im only adds the canvas size. when reading a PNG that does nto have a canvas size, it will try and figure out an appropriate canvas size so the image remain visible.
See IM Examples Common File Formats, PNG and the virtual canvas
http://www.imagemagick.org/Usage/formats/#png_offsets
You however reset any offset that was present in the image using -page before reading the image. But you can also reset it using -repage as well after reading.
for example...
Code: Select all
convert \( bg_image.png +repage \) \( overlay.png -repage 0x0+25+25 \) ....
Another alturnative is to have used -layers merge +repage instead of -flatten This ignores any existing canvas size information and generates the smallest image that contains all the image layers. However you again may have to remove that images offset and canvas information to finish up.
See Layers Merge
http://www.imagemagick.org/Usage/layers/#merge
Also using -composite instead would have ignored all layer information present (different technique and style of image handling) You would set an 0ffset using -geometry. However while it ignores all layer offsets and sizes, it does NOT clear that information if present either.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: unexpected result of image flattening - doubling the width..
Very comprehensive and educational - thanks Anthony - will refine technique accordingly.