thecoalman wrote: ↑
Tue Jan 07, 2020 9:51 pm
Works here, does not work on my forum apparently because but I have some custom edits
I see the same result you've confirmed; that here on phpbb.com/community
the upload of .JPG is able to retain it's original quality.
What I see in poking at this further is that the "phpBB processes at 85% quality even if the file is already within image resolution limits"
behavior being observed in the previous tests requires that a resolution limit is in fact set
. Indeed I was testing with a phpBB image resolution limit set during the previous testing, as part of the overall investigation which was occurring.
If I remove the "Maximum image dimensions:"
limit on my test board (leaving only a file size limit), then I see the same behavior as phpbb.com/community
where the attachment will not
be re-processed at 85%. And by viewing the page source on the posting form, I can confirm that phpbb.com/community
have an image resolution limit set for plupload to honor.
Looking back at the plupload code, this behavior appears to occur because of the !plupload.isEmptyObj(up.settings.resize)
condition which is checked before invoking resizeImage(). If no image resolution limit parameters were ever passed to plupload by phpBB, there is no chance for plupload to reach the preserve_headers == true and quality == undefined
test previously referenced.
So bottom line, even though the image may be fully within
the effective phpBB image dimension limits in both scenarios, there is a different outcome depending upon whether a phpBB image dimension limit is actually set
in the ACP. If no dimension limit is set in phpBB, neither the hard-coded 85% quality nor the hard-coded preserve_headers will be imposed on images uploaded. But if a dimension limit is set in phpBB, even images that are already within the set limit will be "forcibly" re-processed for quality and headers anyway.
ouiouiphoto wrote: ↑
Tue Jan 07, 2020 1:15 pm
Is the anyway to keep this neutral asking plupload not to change the original file ?
The previous described observations mean that one way you could avoid this is to remove the "Maximum image dimensions:"
limit set in ACP. (i.e. Set this back to "0 x 0 px"
in the ACP Attachment Settings.) And use only the file size limit (in bytes, KB, MB, etc.) to control uploads to the board.
If you need to keep the "Maximum image dimensions:"
limit, no there isn't a way to "keep whatever the current quality is in the existing JPG file." Or at least, it would require some custom phpBB core and/or plupload code changes to achieve that outcome.