无法调整高分辨率图像文件的大小
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论