class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
am a k2 user. The component (like you know) is using class.upload.php
I would like to prevent the source file from changing image quality and DPI after upload. If my original file is 86 (image quality) and 72 dpi, the uploaded file will change to 100 (image quality) and 96 dpi. Make it the files 3 times bigger.
My settings are these (strangely) : $this->jpeg_quality = 85;
When you upload your original file in K2 component (on Joomla) : it keeps a source file in /media/k2/items/src
then it will create other image of different sizes (as predefined in k2 settings in Joomla back-end) and place them in /media/k2/items/cache >>> These are OK.
My issue is with the uploaded source file, here's a copy : http://test-photo.securemu.com/258ee2700b8562b5d51ebf2117179b3d.jpg File: 6,071Kb | Image quality: 100 | DPI : 96 | Dimension : 3250 x 2171
My original file : http://test-photo.securemu.com/test-photo-before-upload.jpg File: 2,337Kb | Image quality: 86 | DPI : 72 | Dimension : 3250 x 2171
Like you can see the uploaded file settings change and become very big. Ideally I want the file to stay the same.
About the logs I don't know where to see that. However here is the full PHP : http://test-photo.securemu.com/class.upload.php.zip
I can give you back-end and FTP access to a test website if I can PM you or mail you.Reply
am a k2 user. The component (like you know) is using class.upload.php
I would like to prevent the source file from changing image quality and DPI after upload.
If my original file is 86 (image quality) and 72 dpi, the uploaded file will change to 100 (image quality) and 96 dpi. Make it the files 3 times bigger.
My settings are these (strangely) :
$this->jpeg_quality = 85;
P.S Am not a coder. ;-)
When you upload your original file in K2 component (on Joomla) :
it keeps a source file in /media/k2/items/src
then it will create other image of different sizes (as predefined in k2 settings in Joomla back-end) and place them in /media/k2/items/cache >>> These are OK.
My issue is with the uploaded source file, here's a copy :
http://test-photo.securemu.com/258ee2700b8562b5d51ebf2117179b3d.jpg
File: 6,071Kb | Image quality: 100 | DPI : 96 | Dimension : 3250 x 2171
My original file :
http://test-photo.securemu.com/test-photo-before-upload.jpg
File: 2,337Kb | Image quality: 86 | DPI : 72 | Dimension : 3250 x 2171
Like you can see the uploaded file settings change and become very big. Ideally I want the file to stay the same.
About the logs I don't know where to see that. However here is the full PHP :
http://test-photo.securemu.com/class.upload.php.zip
I can give you back-end and FTP access to a test website if I can PM you or mail you.
K2 is setting the JPEG quality to 100 when storing the first image:
https://github.com/getk2/k2/blob/8249eae20390c569a11521ef4f32f75f5376ab3b/administrator/components/com_k2/models/item.php#L264
Your only solution is to hack K2 as it is hardcoded.