无法调整高分辨率图像文件的大小

发布于 2024-10-05 20:46:13 字数 1052 浏览 0 评论 0原文

我正在使用 php 函数来调整图像大小。这是我正在使用的功能的链接。

http://mediumexposure.com/smart- image-resizing-while-preserving-transparency-php-and-gd-library/

它适用于低分辨率图像,但我在上传高分辨率图像时遇到问题。当我尝试上传分辨率为 4320 × 3240 的 JPEG/图像时,它不会调整大小......相反,它只是跳过调整大小并将文件移动到目的地。

我想知道该功能是否能够以更高分辨率调整图像大小。如果是,那么可能出了什么问题?

这是我用来调整大小的代码:

include('smart_resize_image.function.php');
ini_set ( "memory_limit", "100M");
 smart_resize_image($targetFile,
                              $width = 930,
                              $height = 640,
                              $proportional = false,
                              $output = 'file',
                              $delete_original = true,
                              $use_linux_commands = false );

我还在 htaccess 中添加了以下代码:

php_value upload_max_filesize 100M
php_value post_max_size 100M

我不介意增加内存限制,因为一次只有一个管理员上传文件。

I am using a php function to resize the images. Here is the link to the function I am using.

http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/

It works alright for the low resolution images, but I face problem while uploading high resolution image. When I try uploading a JPEG/image with a resolution or 4320 × 3240 it does not resize....instead it just skips resizing and moves the file to the destination.

I would like to know if the function is capable of resizing the image with higher resolution. If yes then what is possibly wrong?

This is the code I am using to resize:

include('smart_resize_image.function.php');
ini_set ( "memory_limit", "100M");
 smart_resize_image($targetFile,
                              $width = 930,
                              $height = 640,
                              $proportional = false,
                              $output = 'file',
                              $delete_original = true,
                              $use_linux_commands = false );

I have also put on following code in htaccess:

php_value upload_max_filesize 100M
php_value post_max_size 100M

I don't mind increasing the memory_limit because only a single admin will be uploading a file at a time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文