Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在一个 php 应用程序中,我接管了使用“imagejpeg”函数创建的 JPG 文件。在每个文件中,都有类似“CREATOR: gd-jpeg v1.0 (using IJG JPEG v80), quality = 90”的注释。现在,我们公司的安全准则要求阻止包含评论的图像。所以我试图在没有评论的情况下生成 JPG。
我在网上搜索,但找不到阻止 gd 添加此评论的方法。是否有可能或者我必须使用另一个库等?
IMO 不可能阻止它,只能使用 Imagick 删除:
$img = new Imagick('input.jpg'); $img->stripImage(); $img->writeImage('output-imagick.jpg'); $img->destroy();