Prevent image resize during uploading

See all posts See thread Reply

Re: Prevent image resize during uploading new!
by Goble002, 2 years, 11 months ago
Thanks for you reply.

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
Re: Prevent image resize during uploading new!
by colin, 2 years, 11 months ago
Thank you. The DPI has no meaning for a JPEG, but the image quaility is what makes the image very big. And I am afraid your issue lies with K2.

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.Reply
Re: Prevent image resize during uploading new!
by Goble002, 2 years, 11 months ago
Thank you so much ! Solved !Reply