Image file upload facility added to the forum

Forum News, Announcements and any issues you're having with the forum

Moderator: myglaren

User avatar
GiveMeABreak
Forum Admin Team
Posts: 37287
Joined: 15 Sep 2015, 19:38
Location: West Wales
My Cars: C3 Aircross SUV HDi Flair Peperoncino Red (The Chili Hornet)
C5 X7 2.0 HDi Exclusive Mativoire Beige (The Golden Hornet)
C3 1.6 HDi Exclusive Aluminium Grey (The Silver Hornet)
C5 MK II 2.0 HDi Exclusive Obsidian Black
C5 MK I 2.0 HDi SX Wicked Red
Xantia S2 2.0 HDi SX Hermes Red
C15 Romahome White
XM 2.0 Turbo Prestige Emerald Green Pearlescent
XM 2.0 Turbo Prestige Polar White
XM 2.0 SX Polar White
CX 20 Polar White
GS 1220 Geranium Red
CX 2.4 Prestige C-Matic Nevada Beige
GS 1000 Cedreat Yellow
x 5708

Re: Image file upload facility added to the forum

Post by GiveMeABreak »

Odd, considering that was a JPG I uploaded from your email.
Please Don't PM Me For Technical Help

Marc
User avatar
myglaren
Forum Admin Team
Posts: 25453
Joined: 02 Mar 2008, 13:30
Location: Washington
My Cars: Mazda 6
Ooops.
Previously:
2009 Honda Civic :(
C5, C5, Xantia, BX, GS, Visa.
R4, R11TXE, R14, R30TX
x 4917

Re: Image file upload facility added to the forum

Post by myglaren »

It is - I uploaded the .jpg too but remembered a glitch a few weeks back where converting to a .png worked.

IIRC it was something in the phone's metadata that cause the original problem.
User avatar
xantia_v6
Forum Admin Team
Posts: 9079
Joined: 09 Nov 2005, 22:03
Location: France or NewZealand
Lexia Available: Yes
My Cars: -
1997 Citroen Xantia V6 (France)
1999 Citroen XM V6 ES9 (France)
2011 Peugeot 308 CC THP 155 (NZ)
1975 Jaguar XJ-S pre-HE (NZ)
x 833

Re: Image file upload facility added to the forum

Post by xantia_v6 »

Can you convert the png back to jpg and try again?
User avatar
bobins
Donor 2023
Posts: 5729
Joined: 05 Jul 2012, 18:07
Location: Midhurst, West Sussex
My Cars: Kia Sportage
Mazda BT-50
Land Rover SIII SWB
V-F-R800
SL320
MX5
x 2885

Re: Image file upload facility added to the forum

Post by bobins »

I had an issue recently where images straight off my phone wouldn't upload, but simply renaming (and saving) them in some image viewing software allowed me to upload them. They weren't resized or anythig else - just renamed.
Sadly no longer a C5 owner :(
xantiav6
Posts: 121
Joined: 06 Jun 2004, 22:31
Location:
My Cars:
x 3

Re: Image file upload facility added to the forum

Post by xantiav6 »

I can now reproduce the problem here, so I will investigate and report back.
User avatar
Mandrake
Posts: 8618
Joined: 10 Apr 2005, 17:23
Location: North Lanarkshire, UK
My Cars:
x 665

Re: Image file upload facility added to the forum

Post by Mandrake »

xantiav6 wrote: 08 Aug 2017, 19:57 I can now reproduce the problem here, so I will investigate and report back.

At least I'm not going mad. :wink:

By the way the picture originates from Video taken from my Dashcam in MOV format, with a still processed and screen grabbed at 1920x1080 using Datakam Player (also known as Registration Viewer) and then cropped using Microsoft Paint. So the image would have been 1920x1080 before MS paint cropped it.

However when I check the metadata in the file I don't see 1920x1080 anywhere, only the correct cropped resolution...
Simon

1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White

2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
User avatar
xantia_v6
Forum Admin Team
Posts: 9079
Joined: 09 Nov 2005, 22:03
Location: France or NewZealand
Lexia Available: Yes
My Cars: -
1997 Citroen Xantia V6 (France)
1999 Citroen XM V6 ES9 (France)
2011 Peugeot 308 CC THP 155 (NZ)
1975 Jaguar XJ-S pre-HE (NZ)
x 833

Re: Image file upload facility added to the forum

Post by xantia_v6 »

I don't know exactly what is happening, but the downsizing of uploaded images is done client-side in your browser, using a library called plupload. This is apparently failing for that file, causing the full size image to be uploaded, which is rejected by our server which was expecting a downsized image.
I had forgotten that moderators and administrators are exempt from the file size limit, so despite the downsizing failing, the image uploaded OK.
User avatar
xantia_v6
Forum Admin Team
Posts: 9079
Joined: 09 Nov 2005, 22:03
Location: France or NewZealand
Lexia Available: Yes
My Cars: -
1997 Citroen Xantia V6 (France)
1999 Citroen XM V6 ES9 (France)
2011 Peugeot 308 CC THP 155 (NZ)
1975 Jaguar XJ-S pre-HE (NZ)
x 833

Re: Image file upload facility added to the forum

Post by xantia_v6 »

If you look at the image properties of the original file in windows explorer or windows photo viewer, the dimensions are given as 803x719, but it you open the file in photoshop, it says that the exif data shows 1920x1080.

I think that the forum plupload script sees the smaller dimension and concludes that the image does not need scaling, but when the forum server checks the uploaded exif header, it finds that the image is too big, should have been scaled and rejects it.

The software that made the image file is obviously faulty, but the forum software does not handle the situation very well.
User avatar
GiveMeABreak
Forum Admin Team
Posts: 37287
Joined: 15 Sep 2015, 19:38
Location: West Wales
My Cars: C3 Aircross SUV HDi Flair Peperoncino Red (The Chili Hornet)
C5 X7 2.0 HDi Exclusive Mativoire Beige (The Golden Hornet)
C3 1.6 HDi Exclusive Aluminium Grey (The Silver Hornet)
C5 MK II 2.0 HDi Exclusive Obsidian Black
C5 MK I 2.0 HDi SX Wicked Red
Xantia S2 2.0 HDi SX Hermes Red
C15 Romahome White
XM 2.0 Turbo Prestige Emerald Green Pearlescent
XM 2.0 Turbo Prestige Polar White
XM 2.0 SX Polar White
CX 20 Polar White
GS 1220 Geranium Red
CX 2.4 Prestige C-Matic Nevada Beige
GS 1000 Cedreat Yellow
x 5708

Re: Image file upload facility added to the forum

Post by GiveMeABreak »

Well - investigated, just checked it out in Photoshop and you can see as Mike says the differences: Top shows image size at source and the second shows actual pixels of the image as it is before doing another resize.
NYPD2.PNG
NYPD1.PNG
That will be helpful to know for future reference.
Please Don't PM Me For Technical Help

Marc
User avatar
Mandrake
Posts: 8618
Joined: 10 Apr 2005, 17:23
Location: North Lanarkshire, UK
My Cars:
x 665

Re: Image file upload facility added to the forum

Post by Mandrake »

I think this is still really a forum bug that the javascript client side resizer and the forum code itself don't agree on whether to use the exif data or not to find the image size.

I had been using MS Paint in Windows 7 to crop images before uploading so I thought I would install something different - the well known free paint.net. Opened an image, cropped it, saved it, tried to upload it, exact same problem. #-o

So it would appear that any photo editing software that doesn't support exif data manipulation (which is most of the free ones) will pass the original unaltered exif data (containing the original image size) through and trigger the problem. I'll see if there is a way to strip the exif data using paint.net or some other utility but it seems like a lot of faffing around to work around the inconsistency in the way the forum and client side resizer interpret the image size. :?

If they both used the same figures from the file and both ignored the exif data the issue wouldn't happen. The forum can't assume the exif data is correct because so much photo editing software doesn't support exif and may leave incorrect exif data in the file when scaling or cropping.
Last edited by Mandrake on 30 Aug 2017, 12:05, edited 2 times in total.
Simon

1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White

2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
elma
Posts: 3745
Joined: 13 May 2007, 02:17
Location: United Kingdom
My Cars: Undisclosed
x 287

Re: Image file upload facility added to the forum

Post by elma »

I had one this morning that wouldn't upload, it said HTML error.
The difference between it and the others was that I had emailed it to myself so I could post from my laptop rather than my phone.
Renaming it solved the problem for me, done the simplest way on my desktop.
I don't really edit photos other than rotating them though so I doubt it's anything to do with Simons difficulties.
User avatar
Mandrake
Posts: 8618
Joined: 10 Apr 2005, 17:23
Location: North Lanarkshire, UK
My Cars:
x 665

Re: Image file upload facility added to the forum

Post by Mandrake »

Update: I used "exif pilot" to strip the exif data from the images cropped using paint.net and sure enough they uploaded without any problem. Bit of a hassle though and not very user friendly for the less technical forum members.
Simon

1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White

2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
User avatar
xantia_v6
Forum Admin Team
Posts: 9079
Joined: 09 Nov 2005, 22:03
Location: France or NewZealand
Lexia Available: Yes
My Cars: -
1997 Citroen Xantia V6 (France)
1999 Citroen XM V6 ES9 (France)
2011 Peugeot 308 CC THP 155 (NZ)
1975 Jaguar XJ-S pre-HE (NZ)
x 833

Re: Image file upload facility added to the forum

Post by xantia_v6 »

Mandrake wrote: 30 Aug 2017, 11:58 I think this is still really a forum bug that the javascript client side resizer and the forum code itself don't agree on whether to use the exif data or not to find the image size.

I had been using MS Paint in Windows 7 to crop images before uploading so I thought I would install something different - the well known free paint.net. Opened an image, cropped it, saved it, tried to upload it, exact same problem. #-o

So it would appear that any photo editing software that doesn't support exif data manipulation (which is most of the free ones) will pass the original unaltered exif data (containing the original image size) through and trigger the problem. I'll see if there is a way to strip the exif data using paint.net or some other utility but it seems like a lot of faffing around to work around the inconsistency in the way the forum and client side resizer interpret the image size. :?

If they both used the same figures from the file and both ignored the exif data the issue wouldn't happen. The forum can't assume the exif data is correct because so much photo editing software doesn't support exif and may leave incorrect exif data in the file when scaling or cropping.

Feel free to submit a patch to phpbb or plupload.
User avatar
Mandrake
Posts: 8618
Joined: 10 Apr 2005, 17:23
Location: North Lanarkshire, UK
My Cars:
x 665

Re: Image file upload facility added to the forum

Post by Mandrake »

xantia_v6 wrote: 30 Aug 2017, 12:17 Feel free to submit a patch to phpbb or plupload.

And if I'm not an experienced programmer in the languages they're written in ? ;)

Unfortunately I already spend way too much of my rapidly dwindling free time working on other open source projects to go and try to spend a lot of time learning yet another code-base in a language I probably don't know, (I do know some php, but not javascript) figuring out how to fix the problem properly and in a way that the developers would accept a patch for. I've been on both ends of that process many times and know what a huge amount of effort it can be for someone who is not familiar with the code or contributing guidelines of a project and/or may have marginal skills in the language in question to fix it the right way.

It's an awful lot of my time for not much benefit when someone who already knows the code could probably fix it in minutes.

I assume the developers of phpbb and/or plupload have been made aware of the issue, if so that's all I can do unfortunately. Beyond that, it just means I probably won't upload images to the forum very often because it has become too much of a hassle unless they are unedited, un-cropped images. Not everybody can afford to use photoshop to do exif friendly cropping. :twisted:
Simon

1997 Xantia S1 3.0 V6 Auto Exclusive in Silex Grey
2016 Nissan Leaf Tekna 30kWh in White

2011 Peugeot Ion Full Electric in Silver
1977 G Special 1129cc LHD
1978 CX 2400
1997 Xantia S1 2.0i Auto VSX
1998 Xantia S2 3.0 V6 Auto Exclusive
User avatar
GiveMeABreak
Forum Admin Team
Posts: 37287
Joined: 15 Sep 2015, 19:38
Location: West Wales
My Cars: C3 Aircross SUV HDi Flair Peperoncino Red (The Chili Hornet)
C5 X7 2.0 HDi Exclusive Mativoire Beige (The Golden Hornet)
C3 1.6 HDi Exclusive Aluminium Grey (The Silver Hornet)
C5 MK II 2.0 HDi Exclusive Obsidian Black
C5 MK I 2.0 HDi SX Wicked Red
Xantia S2 2.0 HDi SX Hermes Red
C15 Romahome White
XM 2.0 Turbo Prestige Emerald Green Pearlescent
XM 2.0 Turbo Prestige Polar White
XM 2.0 SX Polar White
CX 20 Polar White
GS 1220 Geranium Red
CX 2.4 Prestige C-Matic Nevada Beige
GS 1000 Cedreat Yellow
x 5708

Re: Image file upload facility added to the forum

Post by GiveMeABreak »

Can't you just use a screen capture tool to re-save the image and then upload? GIMP is open source too....
Please Don't PM Me For Technical Help

Marc
Post Reply