1

Twitpic recently made changes to their API and their photo url 'http://twitpic.com/show/full/auuqys' is now getting resolved to a huge Cloudfront url (below)

http://d3j5vwomefv46c.cloudfront.net/photos/full/656484868.jpg?key=10231023&Expires=1347869743&Key-Pair-Id=APKAIYVGSUJFNRFZBBTA&Signature=gAU4mFGNs6qcrC5nE7~9FeVYXTiVJtpK9XUvkLTuQnAOZsNMysFxUuCLc8IkJh8iNdqSUXXEBk0A~0bMO~IHvI30zFL5oyOpEgmrLqCgbcml4rde75wgzARSmqLoLXNj37jLiv5pJ-mDj3Hqlp7KFxk-13HPApLRlIiW3SyC9Jw_

but Fancybox is unable to resolve and render but instead it gives an error

'Requested content cannot be loaded'. 

How do I render redirected urls using FancyBox. Please Help.

Thanks

Nazim Zeeshan
  • 713
  • 1
  • 12
  • 20
  • Show us your code for how this URL is being loaded by FancyBox. Does the same URL work if you put it in a plain old `` tag? FancyBox version 1 or 2? – nickdos Sep 17 '12 at 09:02
  • 1
    you sometimes need to tell fancybox that it is loading an image, especially if the URL doesn't end with .jpg or something obvious like that. Try setting the content type, more details here: http://fancybox.net/faq – totallyNotLizards Sep 17 '12 at 09:37
  • @jammypeach Thanks a lot! adding type = image worked! – Nazim Zeeshan Sep 17 '12 at 11:48
  • @NazimZeeshan no problem, I added it as an answer, please mark as accepted if that works for you :) – totallyNotLizards Sep 17 '12 at 12:43

2 Answers2

1

From the fancybox FAQs:

I`m using custom urls for images (for example, index.php?action=dlattach;topic=3.0;attach=9;image) and FancyBox shows source of image. Why?

FancyBox gueses content type from url but sometimes it can be wrong. The solution is to force your type, like so - $(".selector").fancybox({'type' : 'image'});

This might help :)

http://fancybox.net/faq

totallyNotLizards
  • 8,489
  • 9
  • 51
  • 85
0

A more clever solution is to append at the the end of the url the image filename.extension

this won't work

index.php?r=generate/image&user_id=9

this will work

index.php?r=generate/image&user_id=9&dummy=dummy.png
Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
andrei
  • 91
  • 6