Page 3 of 3

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Mon May 13, 2019 11:00 am
by AmigoJack
EA117 wrote:
Mon May 13, 2019 10:31 am
As compared to downloading the one Mick successfully attached (the actual attachment; not the one using an [img] link) which has modified headers and content, whether that happened post-upload or pre-upload.
I was referring to those two different files.

The overall issue is to parse JPEG files only partially. Maybe an outcome of the wrong decision to base parsing onto loading entire parts of a file into memory (instead of accessing file positions only to what is parsed and recognized).

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Tue May 14, 2019 1:19 am
by Kot Matroskin
Btw, I've created a ticket for that: https://tracker.phpbb.com/browse/PHPBB3-16056

Originally I created it by cloning another one, that is why you can see incorrect "Fix Version/s" field. I have no permissions to change this field.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Fri Jan 10, 2020 11:12 pm
by PaulusB
After the update to 3.2.9 is get the same error only on small png files one file was 634 x 140, large PNG files no problem.
error It was not possible to determine the dimensions of the image. Make sure the URL you entered is correct.
Same error here on phpbb.com with the same image see attachment.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 1:07 am
by 2600
When are they going to fix this? This has been a years long problem. Though, I can't say I ever had the issue. Maybe once or twice many years ago.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 1:01 pm
by 3Di
It seems to me it is fixed.

Original file: https://scooterclub.by/tmp/P90505-140230.jpg
(I saved this one with right-mouse-button/download image as and it contains the metadata.)


P90505-140230.jpg

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 1:49 pm
by PaulusB
Upload this picture is to this topic

Image

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 1:55 pm
by 3Di
PaulusB wrote:
Sat Jan 11, 2020 1:49 pm
Upload this picture is to this topic
...
Not in the IMG bbcode pls: https://www.vwforum.nl/images/logo2020b.png ..



And done.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 2:14 pm
by PaulusB
Why do I get with the same file the error on this forum and my forum? And u not. Chrome in Android and firefox on pc same result.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 2:24 pm
by 3Di
try using F12 and inspect the issue in the "network tab". - here FF and Windows.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Sat Jan 11, 2020 4:45 pm
by PaulusB
I see this.

And in the console this error

HTML1403: De numerieke tekenverwijzing wordt niet omgezet in een geldig teken.

Translated:

HTML1403: The numeric character reference is not converted to a valid character.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Tue Jan 14, 2020 3:48 am
by 3Di
PaulusB wrote:
Fri Jan 10, 2020 11:12 pm
After the update to 3.2.9 is get the same error only on small png files one file was 634 x 140, large PNG files no problem.
error It was not possible to determine the dimensions of the image. Make sure the URL you entered is correct.
Same error here on phpbb.com with the same image see attachment.
Obviously your image is not a PNG but a JPEG/JFIF as per https://www.filesignatures.net/index.ph ... F&mode=EXT

This is the hexadecimal signature of https://www.vwforum.nl/images/logo2020b.png
FF D8 FF E0 00 10 4A 46 49 46 00 01 01 00 00 01

2020-01-14 04_42_31-EditPlus [325]  - [logo2020b.png].png
2020-01-14 04_42_31-EditPlus [325] - [logo2020b.png].png (2.63 KiB) Viewed 437 times

The library checks for a PNG due to its filename extension

Code: Select all

namespace FastImageSize\Type;

class TypePng extends TypeBase
{
	/** @var string PNG header */
	const PNG_HEADER = "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a";

	/** @var int PNG IHDR offset */
	const PNG_IHDR_OFFSET = 12;

The image if really a png one, must have this hex header ( see: https://www.filesignatures.net/index.ph ... A&mode=SIG )
89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52

2020-01-14 04_05_33-EditPlus-PNG.png
2020-01-14 04_05_33-EditPlus-PNG.png (11.14 KiB) Viewed 437 times
Conclusion, rename the image as per the link https://www.vwforum.nl/images/logo2020b.png as logo2020-C.png.jpg and try again.

2020-01-14 05_02_37-phpBB • Problem with uploading large jpg files after update 3.2.2 - Page 3.png

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Tue Jan 14, 2020 4:06 am
by KYPREO
I have had this error come up once or twice. In my case, it was that the image host sat the JPG images behind a HTML page with a JS challenge to prevent hotlinking and scraping of images. When phpBB went to check the image dimensions, it saw a HTML file, not a JPG.

In essence, It's the same error as described above, because when phpBB checks the file, it is an unexpected MIME type / extension.

I think what is confusing here is that the error refers to not being able to determine image dimensions, rather than incorrect MIME type. Perhaps the error message should be changed to indicate the image has the wrong extension or MIME type eg

Code: Select all

Error: unexpected image extension or MIME type. Make sure the file type and extension for the file you entered is correct.

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Wed Jan 15, 2020 7:15 pm
by PaulusB
@3Di thank u for the explanation :D

Re: Problem with uploading large jpg files after update 3.2.2

Posted: Wed Mar 25, 2020 1:54 am
by russian2
AmigoJack wrote:
Thu Jan 18, 2018 1:44 pm
No, this "bug" persisted in 3.2.1 and 3.2.0 already. What you refer to had (a) different culprit(s).

You can fix it yourself by opening /vendor/marc1706/fast-image-size/lib/Type/TypeJpeg.php and finding:

Code: Select all

	const JPEG_MAX_HEADER_SIZE = 124576;
and changing it to a size you feel comfortable with (i.e 10* 1024* 1024 for scanning up to 10 MiB).
Thank you, this has solved this for me!