1

I right tried to upload an image to use in a post, but it was not accepted because the following error:

Failed to upload image; the format is not supported

The image was a JPEG; I also tried with a PNG image, but I got the same error. I then noticed the URL started with https://, tried with http:// but I got the same result.
The only way I had to add the picture was to take a screenshot of it, and then add it to the post.

Are there other restrictions that are applied? This is the first time I have such an error.

This is the image I am trying to include: http://drupal.org/files/project-images/path_breadcrumbs_settings_page.png.

I have tried with Firefox 21 and Safari 6.0.5 (8536.30.1) running on OS X 10.8.4, but the result doesn't change.

8
  • related: meta.stackexchange.com/questions/184641/…
    – Oded StaffMod
    Commented Jun 18, 2013 at 11:23
  • Can you let me know what mime-type is tried? Also, what OS and browser?
    – Oded StaffMod
    Commented Jun 18, 2013 at 11:24
  • 1
    Though, looking at the code, the problem appears to be at the imgur end :(
    – Oded StaffMod
    Commented Jun 18, 2013 at 11:28
  • @Oded yes, it's working if you save the image and upload it from your computer. I think there is some redirect on drupal.org server. Commented Jun 18, 2013 at 11:30
  • @ShaWizDowArd - That would certainly cause problems.
    – Oded StaffMod
    Commented Jun 18, 2013 at 11:32
  • @Oded nailed it. drupal.org are blocking remote requests to their files, trying to download the image with simple DownloadData() of the WebClient class resulted in "The remote server returned an error: (403) Forbidden" Commented Jun 18, 2013 at 11:41
  • @ShaWizDowArd - thanks for investigating. Why not post an answer?
    – Oded StaffMod
    Commented Jun 18, 2013 at 11:45
  • @Oded good idea, done. Commented Jun 18, 2013 at 11:53

1 Answer 1

5

From some quick investigation it appears that drupal.org are blocking remote requests to their files.

Trying to download the image using code (simple DownloadData() of the WebClient class in C#) resulted in:

The remote server returned an error: (403) Forbidden

This means that imgur code can't get images from drupal.org, it's not Stack Exchange fault or imgur fault.

Either ask drupal.org to remove the block, or host images elsewhere. :)

One thing though, it would be better to change the error message from "format is not supported" to something like "failed to fetch remote image, error [number here]" which will make it more clear why it failed.

7
  • I can confirm this in PHP. The fact that it reads You should know better indicates that it is very much intentional.
    – Antony
    Commented Jun 18, 2013 at 11:53
  • Oh! It must be a recent change, then, since I didn't have that problem before. I didn't think of that since I can see the images from my computer. Thinking better, it seems obvious why: I am watching the image clicking on a link from that site. :) Yes, the error message is confusing, since I thought the image was not returned with the correct content type.
    – avpaderno
    Commented Jun 18, 2013 at 11:54
  • @Antony looks like "you should know better" coming from PHP, don't see it with my C# code. Commented Jun 18, 2013 at 11:55
  • @kiamlaluno yeah, they expect a valid user agent. Probably it's possible to fool them by passing dummy browser details, but don't think it's a good idea. :) Commented Jun 18, 2013 at 11:59
  • @ShaWizDowArd I have checked. This message comes from drupal.org, not PHP.
    – Antony
    Commented Jun 18, 2013 at 11:59
  • @Antony OK, probably I didn't look deep enough. Cheers! Commented Jun 18, 2013 at 12:01
  • <insert obligatory Inception joke here> Commented Jun 18, 2013 at 13:13

You must log in to answer this question.

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