-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File size increases almost 300% #632
Comments
Pictures of code? Greetings |
Hi, With Glide : https://github.com/thephpleague/glide $server->outputImage($path, []); My image size too increases around 200% or 300%. Glide related code is here : An example image : |
I'm running into the same issue where my images filesize is being increased by 300% when using |
I have the same issue:
I'm trying this code, what do you think about? |
This is still an issue, it is not handling the file as I would expect... Here is some example code and steps to repeat (really.. save any image with 100 quality)
<?php
$fileopen = __DIR__.'/testimage.jpg';
$filesave = __DIR__.'/testimage_saved.jpg';
// report file size
clearstatcache();
$filesize = filesize($fileopen);
echo "Current file size: {$filesize}\n";
// load image and save it immediately
require 'vendor/autoload.php';
use Intervention\Image\ImageManager;
$manager = new ImageManager(array('driver' => 'gd'));
$image = $manager->make($fileopen);
$image->save($filesave, 100);
// report file size
clearstatcache();
$newsize = filesize($filesave);
echo "Current file size: {$newsize}\n";
// report increase
$increase = round(($newsize / $filesize) * 100, 5);
echo "Increase = {$increase}%\n"; Output:
Not sure on cause, maybe file system? (I'm on a mac), maybe GD library? Who knows. What this means is that if you do: Output with 80%
I understand there will be some processing added and the algorithm Intervention uses, however 260% is a bit crazy. I don't think the original MS paint was that bad :D |
If you are you using GD, it may be caused by what is described by this answer. A solution could be switching to ImageMagick. |
Having the same issue.
|
I have the same problem. I solve it by using quality 60 - 80. |
Jan 9, 2023. The issue still exists. Driver: Imagick. It is enough to save at 100% quality to reproduce. Any suggestions? |
Facing same issue but not suitable solution founded |
The same issue ( |
I have been running into the issue where if a user uploads an jpeg and we store it via Image::make(img-data) and then $image->save(....); The file size increases almost 300%. For example, I uploaded a 323mb file and it uploaded as a 900mb file.
Does saving it out at the default 90% quality increase file size even if the image was optimized before being uploaded?
The text was updated successfully, but these errors were encountered: