简体   繁体   中英

libGD perl and php wrapper output differs

I'm currently working on a project that involves a comparison between different image processing libraries. One of these libraries is libGD. I'm using the perl wrapper as well as the php wrapper.

My problem now is that the same input image produces completely different output images depending on which wrapper was used. If I invoke the libGD function via the perl wrapper the resulting image is roughly 40% larger than the output of the php wrapper. A difference image made with imagemagick also shows that both images are very different.

The parametrization of both function calls is absolutely identical (quality, resolution, geometry). I also checked if there is more than one version of libGD installed on my system, there is not.

Shouldn't both wrappers produce the same output or am I completely mistaken?

Both libs made exactly the same library calls. The problem was that the perl wrapper should produce truecolor images as a default, he also writes truecolor as the type into the image header. (imagemagicks identify outputs truecolor as type). But in reality it's not a truecolor but a palette image. When manually set to truecolor the images are 100% identical.

Thanks for your time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM