7

http://www.litaniasports.com/facility/documents/00396-009%20Wave%20Bike%20Rack.jpg

I can't come up any idea why this picture cannot be added by uploading from URL. The file size is over 1.6 MB a little bit, so it is much less than the max of 2 MB.

Failed to upload image; the format is not supported

26
  • 2
    Related: meta.stackexchange.com/q/261925/245360 Commented Aug 3, 2015 at 9:13
  • Looks like it was created by some fancy software, in the raw response I see "Adobe Photoshop CS3 Windows", and this format is simply not supported by imgur, which tries to analyze the picture. Commented Aug 3, 2015 at 9:23
  • It still seems a regular JPG to me. @ShadowWizard Commented Aug 3, 2015 at 9:24
  • 2
    That error happens inside imgur; as such, I can't tell you what specifically it doesn't like (the error message is fairly generic) - as @ShadowWizard notes: presumably there is an encoding option in use that imgur doesn't like. Options: 1) imgur change their API to allow the format; 2) you re-save the file to tweak the encoding; 2 seems like a more timely fix Commented Aug 3, 2015 at 14:39
  • Agree with @Marc that this probably isn't worth spending much time on, unless we'll see this happening more. Commented Aug 3, 2015 at 14:50
  • @MarcGravell "the issue seems to be on the SE's imgur interface where some kinda URL validation (and/or filename check) is happening before the image upload" - quoted HackerKarma below
    – Ooker
    Commented Aug 3, 2015 at 15:05
  • @Ooker SE's imgur interface from where the API sends the data to imgur... I would like to see what the endpoint respone looks like... we need to look into base64 + url encoding which is causing the wrong interpretation of the final url Commented Aug 3, 2015 at 15:09
  • @Ooker I'll take another look Commented Aug 3, 2015 at 15:09
  • @MarcGravell I agree the response is generic... i know you guys are super busy but please look into the response header .... like I said in the above comment Commented Aug 3, 2015 at 15:10
  • @HackerKarma <error><message>Image format not supported, or image is corrupt.</message>...; I'm checking something, though Commented Aug 3, 2015 at 15:20
  • @HackerKarma your comment isn't clear, but if you work for imgur ("we need to look into", etc), feel free to ping me at [email protected], and we can talk more - but I'm not going to dump the raw http (including keys, etc) here ;p Commented Aug 3, 2015 at 15:27
  • @MarcGravell Appreciated. If that's what imgur sending then they must be striping out all other data like "parameters:, request:, type:, method:, success:.... etc. I think we have to look into the "CONFIG" options that API gets.... base64 encoding ... Commented Aug 3, 2015 at 15:30
  • 1
    Let us continue this discussion in chat. Commented Aug 3, 2015 at 15:38
  • 1
    To confirm: looks like I am wrong and this is our fault; we should be able to fix it soon Commented Aug 3, 2015 at 15:40
  • 1
    @Ooker. No, I am not targeting you either. The official ♦ mod answer and upvotes, as far as my answer goes, and in general. How many of those upvoters do you think read my answer, comments, conversation with Marc. If they did then why am I left with 2 votes (excluding your's). That's why that joke but [status-completed] was my takeaway. But, since I worked so hard for this answer, I felt little sad to see your un-acceptance. And, that was it, nothing against you. You're fine. Comments are getting lengthy so its my last comment. Commented Aug 3, 2015 at 19:36

3 Answers 3

7

This has something to do with Stack Exchange's imgur upload interface. May be the file resize algorithm (ShadowWizard's comment below), file encoding settings, etc that goes while analyzing the image before the actual upload. I just uploaded the OP's suggested image by visiting to http://www.imgur.com and used "enter image URLs" option to upload the image.

Here is the direct link to uploaded image using "enter image URLs" at imgur:

![Direct link](https://i.sstatic.net/Fj4b2.jpg)

enter image description here

Here is the same above image added by uploading from URL using "SE's imgur interface":

enter image description here

Now, here is some food for thought. Upon doing further investigation on few things such as:

  1. Source site blocking imgur from accessing
  2. Imgur blocking/banning the source site
  3. Invalid image type
  4. URL format of the image without any special chars in it (especially in the "file name")

As far as the first three points goes, there is no issue at all. My first two screenshots voids all those first 3 points. So, the next thing left was to try and upload images from the same source with proper file name.

Here I am uploading http://www.litaniasports.com/images/stadium.jpg using SE's imgur file uploader: (works perfectly!)

enter image description here

Now, I tried another image (from the same source) with a special char %20 i.e. a space in it http://www.litaniasports.com/facility/documents/830901%20Closed.jpg

and it throws the following error: (as said by OP)

Failed to upload image; the format is not supported

So, the problem is not about the file type or its format, it has something to do with the special char i.e. %20 (a space) in the image filename. The special character (%20) in the image filename has no issue when you do a direct web-upload (by entering image URL) on the imgur.com website. So, the issue seems to be on the SE's imgur interface where some kinda URL validation (and/or filename check) is happening before the image upload.

That's what I can think here. Please share your thoughts or any additional findings.

1
  • 1
    True, that's likely because the resize algorithm that imgur is trying to use on behalf of Stack Exchange, which fails for some reason for that specific picture. Commented Aug 3, 2015 at 10:40
14

The reason for that is because the .NET Uri class has a distressing habit of not quite retaining what you put into it ;p In the next build, we have circumvented this glitch, and the url you show above now works fine - as do other URLs.

11
  • 1
    you're stealing all my +1's :) No issue... [status-completed] is the biggest upvote for me and my contribution to SE. Commented Aug 3, 2015 at 16:19
  • lol, R.I.P my glorious theory... :-D Commented Aug 3, 2015 at 17:34
  • This is not fair at all... I can understand the votes but un-accepting answer that was right is very demoralizing. I worked hard for this debugging, reading imgur API pages and chatting to Marc Gravell: chat.meta.stackexchange.com/rooms/907/… Commented Aug 3, 2015 at 17:40
  • @ShadowWizard what glorious theory? Commented Aug 3, 2015 at 17:40
  • @HackerKarma that the problem is in imgur's code Commented Aug 3, 2015 at 17:41
  • @HackerKarma why not fair? You should know the risks when answering bug reports. Commented Aug 3, 2015 at 17:44
  • @ShadowWizard I don't get it... To confirm: looks like I am wrong and this is our fault; we should be able to fix it soon – quote Marc Gravell Commented Aug 3, 2015 at 17:44
  • @Hacker imgur is not part of Stack Exchange just provides the image hosting and API (if you got more questions or comments I can help with, please hit me on chat let's not flood poor Marc here :)) Commented Aug 3, 2015 at 17:45
  • @ShadowWizard read my comment above. I will leave this up to Marc to clarify. Commented Aug 3, 2015 at 17:46
  • @HackerKarma: Your answer certainly deserves upvotes, but the accepted answer should be the one that answers the question most clearly and definitively. For bug reports, that usually means an answer from the SE devs saying that they've fixed (or will fix, or will not fix) the bug. Don't take it personally; just enjoy the rep from the upvotes, and live with the fact that the +15 rep from getting accepted is likely temporary. Commented Aug 3, 2015 at 20:32
  • @IlmariKaronen Appreciated. But, in some cases, if you know the API then you can point the bug which in this case was "URL wrapping/encoding/validation". In fact, Marc and I had a chat (after our comments got lengthy) on this. Anyway, no worries. Commented Aug 3, 2015 at 20:47
5

In all the irony . . .

I just saved the file and uploaded it again. You could do the same yourself.

5
  • 1
    So the URL upload doesn't work. The picture upload does. Commented Aug 3, 2015 at 9:17
  • 1
    Yes. Maybe it's an issue with their server. BTW @Patrick is this kinda answer acceptable? I did show the solution/showed more precisely where a possible bug is. . .
    – M.A.R.
    Commented Aug 3, 2015 at 9:18
  • Don't know. In my opinion it should just be fixed. Commented Aug 3, 2015 at 9:20
  • @PatrickHofman It's SE's imgur upload doesn't work. See my answer below Commented Aug 3, 2015 at 10:41
  • @inɒzɘmɒЯ.A.M No, it's not a server issue... please see my answer. Commented Aug 3, 2015 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .