Problem trying to convert a JPG to PNG and add an alpha mask
Posted: 2008-02-19T16:00:09-07:00
I'm trying to convert a JPG to a PNG and add an alpha mask. Here's the code I have currently. My script dies during MagickSetImageAlphaChannel and error_reporting(E_ALL) doesn't say why.
My php error log only reports the following, it never makes it to MagickEvaluateImage():
Can anyone provide some insight on the proper way to accomplish this task?
Thanks,
Dave
Code: Select all
MagickSetImageFormat($wnd, "PNG32");
error_log("MagickSetImageFormat", 0);
MagickSetImageAlphaChannel($wnd, MW_ActivateAlphaChannel);
error_log("MagickSetImageAlphaChannel", 0);
MagickEvaluateImage($wnd, MW_DivideEvaluateOperator, (100/$alpha), MW_AlphaChannel);
error_log("MagickEvaluateImage", 0);
Code: Select all
[Tue Feb 19 16:57:17 2008] [error] [client 208.42.140.15] MagickCropImage
[Tue Feb 19 16:57:17 2008] [error] [client 208.42.140.15] MagickSetImageFormat
Thanks,
Dave