• <bdo id='FpxQw'></bdo><ul id='FpxQw'></ul>
  • <tfoot id='FpxQw'></tfoot>

    <legend id='FpxQw'><style id='FpxQw'><dir id='FpxQw'><q id='FpxQw'></q></dir></style></legend>

      1. <small id='FpxQw'></small><noframes id='FpxQw'>

        <i id='FpxQw'><tr id='FpxQw'><dt id='FpxQw'><q id='FpxQw'><span id='FpxQw'><b id='FpxQw'><form id='FpxQw'><ins id='FpxQw'></ins><ul id='FpxQw'></ul><sub id='FpxQw'></sub></form><legend id='FpxQw'></legend><bdo id='FpxQw'><pre id='FpxQw'><center id='FpxQw'></center></pre></bdo></b><th id='FpxQw'></th></span></q></dt></tr></i><div id='FpxQw'><tfoot id='FpxQw'></tfoot><dl id='FpxQw'><fieldset id='FpxQw'></fieldset></dl></div>

        在 PHP 中将 JPG/GIF 图像转换为 PNG?

        Convert JPG/GIF image to PNG in PHP?(在 PHP 中将 JPG/GIF 图像转换为 PNG?)
        <i id='xSAHO'><tr id='xSAHO'><dt id='xSAHO'><q id='xSAHO'><span id='xSAHO'><b id='xSAHO'><form id='xSAHO'><ins id='xSAHO'></ins><ul id='xSAHO'></ul><sub id='xSAHO'></sub></form><legend id='xSAHO'></legend><bdo id='xSAHO'><pre id='xSAHO'><center id='xSAHO'></center></pre></bdo></b><th id='xSAHO'></th></span></q></dt></tr></i><div id='xSAHO'><tfoot id='xSAHO'></tfoot><dl id='xSAHO'><fieldset id='xSAHO'></fieldset></dl></div>
            <bdo id='xSAHO'></bdo><ul id='xSAHO'></ul>

            1. <tfoot id='xSAHO'></tfoot>

              • <small id='xSAHO'></small><noframes id='xSAHO'>

                    <tbody id='xSAHO'></tbody>

                • <legend id='xSAHO'><style id='xSAHO'><dir id='xSAHO'><q id='xSAHO'></q></dir></style></legend>
                  本文介绍了在 PHP 中将 JPG/GIF 图像转换为 PNG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  可能重复
                  将jpg图像转换为gif、png &使用PHP的bmp格式

                  我有一个 PHP 表单,它允许上传图片并检查 exif_imagetype(); 以确保图片有效.

                  I have a PHP form that allows image uploads and checks exif_imagetype(); to make sure an image is valid.

                  但是,我希望所有格式(PNG、JPG、JPEG 和 GIF)在提交后最终都是 PNG.

                  However, I want all formats, PNG, JPG, JPEG, and GIF, to end up being PNG once submitted.

                  我该怎么做?

                  推荐答案

                  你只需要imagepng() 那么.事实上,它几乎变成了一条线:

                  You just need imagepng() then. In fact it almost becomes a one-liner:

                   imagepng(imagecreatefromstring(file_get_contents($filename)), "output.png");
                  

                  您将使用 $_FILES["id"]["tmp_name"] 作为文件名,并且显然使用不同的输出文件名.但是图像格式探测本身就会变得多余.

                  You would use $_FILES["id"]["tmp_name"] for the filename, and a different output filename obviously. But the image format probing itself would become redundant.

                  这篇关于在 PHP 中将 JPG/GIF 图像转换为 PNG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                • <legend id='KBnSJ'><style id='KBnSJ'><dir id='KBnSJ'><q id='KBnSJ'></q></dir></style></legend>
                  <tfoot id='KBnSJ'></tfoot>
                    <bdo id='KBnSJ'></bdo><ul id='KBnSJ'></ul>
                        <tbody id='KBnSJ'></tbody>
                    • <i id='KBnSJ'><tr id='KBnSJ'><dt id='KBnSJ'><q id='KBnSJ'><span id='KBnSJ'><b id='KBnSJ'><form id='KBnSJ'><ins id='KBnSJ'></ins><ul id='KBnSJ'></ul><sub id='KBnSJ'></sub></form><legend id='KBnSJ'></legend><bdo id='KBnSJ'><pre id='KBnSJ'><center id='KBnSJ'></center></pre></bdo></b><th id='KBnSJ'></th></span></q></dt></tr></i><div id='KBnSJ'><tfoot id='KBnSJ'></tfoot><dl id='KBnSJ'><fieldset id='KBnSJ'></fieldset></dl></div>

                            <small id='KBnSJ'></small><noframes id='KBnSJ'>