Image URLs from REST API Don't Always Work in Firefox
o_swas
Registered Users Posts: 6 Beginner grinner
Hello,
I'm using the REST API to query my available albums and the pictures in the albums. I use the smugmug.images.getURLs method to get the URLs for the images.
I've built a little slide show of the images in a particular album. The slideshow uses JavaScript to iterate over all of the image URLs and dynamically update an img tag's src attribute with the image URL. So far, so good.
The problem is, some of the images appear in Firefox, and some don't. I couldn't figure out why. Ironically, the same URL produces the image in IE. Digging deeper, I used Firefox's Page Info window and noticed that they "type" for images that appear is image/jpeg, while for those that don't appear, it's text/html.
It appears that Firefox doesn't render the image when the content-type is text/html, but it does when the content-type is image/jpeg.
This is fairly random and of course the content type is served by SmugMug, not by anything I do.
Is there any way around this problem? If it's on SmugMug's end, can it be fixed fairly easily? I need to use Firefox because of it's superior CSS rendering on other parts of my page.
Thank you!!!
-Ryan
I'm using the REST API to query my available albums and the pictures in the albums. I use the smugmug.images.getURLs method to get the URLs for the images.
I've built a little slide show of the images in a particular album. The slideshow uses JavaScript to iterate over all of the image URLs and dynamically update an img tag's src attribute with the image URL. So far, so good.
The problem is, some of the images appear in Firefox, and some don't. I couldn't figure out why. Ironically, the same URL produces the image in IE. Digging deeper, I used Firefox's Page Info window and noticed that they "type" for images that appear is image/jpeg, while for those that don't appear, it's text/html.
It appears that Firefox doesn't render the image when the content-type is text/html, but it does when the content-type is image/jpeg.
This is fairly random and of course the content type is served by SmugMug, not by anything I do.
Is there any way around this problem? If it's on SmugMug's end, can it be fixed fairly easily? I need to use Firefox because of it's superior CSS rendering on other parts of my page.
Thank you!!!
-Ryan
0
Comments
i believe the reason you're seeing the different types in firefox is that you're pulling some of your images from a gallery that has external linking turned off. When you request an image that has external linking off smugmug returns nothing. Firefox then has no choice but to interpret that as text/html because there is no image.
You probably have the image cached in internet explorer, which is why they are showing up there. Check your gallery settings.
this is a guess, but give it a check.
Thank you!!