Page 2 of 3

Re:

Posted: Thu Sep 20, 2018 3:17 am
by Tryss
EdLee wrote:Hi Tryss,

It's iOS; files and filenames are not readily shown.
Please see the reproducible steps and error message in post 13.


That's why I ask this question : If you're trying to upload a jpg trying to make it pass as a png (or the opposite), the rejection makes sense.

I got the same error message if I rename a .jpg as a .png and try to upload it.

Posted: Thu Sep 20, 2018 4:37 am
by EdLee
Hi Tryss,

Hmm, thanks. I thought we were past the 1980's DOS era where a filetype was determined by its extension ( which is easier to rename ), and not by its binary "header" bytes ( which is more involved to mess with ). Sigh.
I'm not trying to pass anything as anything else, as the steps show;
but it could be a 'bug' in iOS Photos...

( Looks like nobody else here has experienced this or tried to reproduce the steps on iOS... Oh, well. )

Re:

Posted: Thu Sep 20, 2018 6:40 am
by BlindGroup
EdLee wrote:Hi Tryss,

Hmm, thanks. I thought we were past the 1980's DOS era where a filetype was determined by its extension ( which is easier to rename ), and not by its binary "header" bytes ( which is more involved to mess with ). Sigh.
I'm not trying to pass anything as anything else, as the steps show;
but it could be a 'bug' in iOS Photos...

( Looks like nobody else here has experienced this or tried to reproduce the steps on iOS... Oh, well. )


Just followed the steps you gave to post this with my iPhone:
8EE69A38-41D9-4298-9EDB-2136F4428B54.jpeg
8EE69A38-41D9-4298-9EDB-2136F4428B54.jpeg (200.36 KiB) Viewed 214616 times


Seems to work. Although, the system seems to have saved the cropped file as a.jpeg. Phone is running iOS 12.

Re:

Posted: Thu Sep 20, 2018 7:08 am
by BlindGroup
EdLee wrote:Hi Dave, Kirby,

1. iOS Photos app: Crop a screenshot, save it to iOS "Photo Library"
2. L19 > Post Reply > Filename > tap "Choose File" button
3. iOS > iphone "Photo Library" > pick cropped photo from (1)
4. tap "Add the file"
5. Error message: Image file type mismatch: expected extension jpg but extension png given
Screenshot:
IMG_0295.PNG


Your post made me wonder if there was a way to change the picture format in iOS. I found this for iOS 11: http://osxdaily.com/2017/09/29/change-i ... jpeg-heif/

Could this be the issue? Maybe L19 is reading the header and confusing the new iOS format for PNG. Unfortunately, these features were changed with iOS 12. So, I couldn't experiment on my phone.

Re: File attachment types

Posted: Thu Sep 20, 2018 5:21 pm
by Kirby
Just to be sure, how about try to email the screenshot to yourself, and see what the extension really is. If you're ambitious, maybe check to see what the header bytes say about the image type (e.g. http://pwet.fr/man/linux/formats/magic).

If it does turn out that L19 is incorrectly identifying the file's proper type, we could modify this, but this part of control is managed by php, and is not a configurable option through phpbb.

Posted: Fri Sep 21, 2018 12:58 pm
by EdLee
Hi Kirby,

If I take a raw screenshot, it's .jpg, and I can upload it here OK.

But if I use iOS Photos to crop it, it's still .jpg, but I get the error message when I try to upload it. At least, the error message seems to be worded incorrectly: it says "extension jpg expected but extension png given".
But the cropped photo does have an extension .jpg.

Re:

Posted: Fri Sep 21, 2018 8:41 pm
by Kirby
EdLee wrote:Hi Kirby,

If I take a raw screenshot, it's .jpg, and I can upload it here OK.

But if I use iOS Photos to crop it, it's still .jpg, but I get the error message when I try to upload it. At least, the error message seems to be worded incorrectly: it says "extension jpg expected but extension png given".
But the cropped photo does have an extension .jpg.


The checks for file extensions are handled in php, so it's hard for me to do much about it, because I don't have access to modify that configuration. Can you send me the cropped file so I can investigate further?

Posted: Fri Sep 21, 2018 9:01 pm
by EdLee
Happy to, except it won't let me upload it here. :)

Re: File attachment types

Posted: Sat Sep 22, 2018 5:24 am
by Kirby
You can email it to me.

My email address is my last name, followed by the first letter in my first name, at the domain for the University of Michigan (5-letter university identifier followed by three letter education extension).

Re: File attachment types

Posted: Sat Sep 22, 2018 8:57 am
by Bill Spight
Kirby wrote:My email address is my last name, followed by the first letter in my first name, at the domain for the University of Michigan (5-letter university identifier followed by three letter education extension).


OMG! :o Sounds like mathlish. :cool: ;)

Posted: Sat Sep 22, 2018 12:27 pm
by EdLee
The 5-letter ID takes a bit of digging... :)

Re: File attachment types

Posted: Sat Sep 22, 2018 1:47 pm
by Kirby
EdLee wrote:The 5-letter ID takes a bit of digging... :)


umich

Re: File attachment types

Posted: Sun Sep 23, 2018 5:37 am
by Kirby
Thanks for sending the attachment, EdLee. I tried uploading here, and it seems to work?

FullSizeRender.jpg
FullSizeRender.jpg (19.2 KiB) Viewed 23645 times


I used the "Upload attachment" feature, and then used "Place inline". Are you using a different process?

Posted: Sun Sep 23, 2018 2:51 pm
by EdLee
Hi Kirby, same process but on an iphone5, Safari.

Re: File attachment types

Posted: Sun Sep 23, 2018 5:46 pm
by Kirby
Using iPhone SE this time.
FDDC6E96-8C4B-4CAE-B036-C4D7AD7DE226.jpeg
FDDC6E96-8C4B-4CAE-B036-C4D7AD7DE226.jpeg (20.15 KiB) Viewed 23626 times


I'll try harder to see if I can find a way to reproduce this behavior..