DISQUS

Scripting News: Bootstrapping thumbnails for photo apps (Scripting News)

  • Sam Ruby · 11 months ago
    Unfortunately, xml namespaces are only valid in xml, and that page isn't xhtml, and xhtml isn't supported by IE.

    I didn't see your original proposal, but it sounds closer to something that would be valid in html and well supported, all you would have had to do is define your additional attributes with the prefix "data-".

    http://dev.w3.org/html5/spec/Overview.html#embe...
  • rogerben · 11 months ago
    Good catch, Sam. Even putting aside the XHTML issues, marrying Dave's original idea of using the link element with @data-* attributes would be significantly more useful than creating a new element in a new namespace.
  • Zach Beane · 11 months ago
    LINK isn't a free-for-all...only certain attributes are allowed, and HEIGHT and WIDTH aren't included. Maybe one of the supported attributes would work instead?
  • dave · 11 months ago
    Thanks -- that's a good point. I guess I'll try another approach. Stay tuned.
  • Sebastian · 11 months ago
    Could you create a central place where you post these "bootstraps"? This would make finding and referencing them easier then on your personal blog.
    Also, finding "bootstraps" could be "crowdsourced". You're interested in photos, other people could be interested in other things.

    A central place for discussion would be useful.
  • dave · 11 months ago
    I appreciate the suggestion, but this is about as central a place as I've got! :-)
  • Scott · 11 months ago
    Redit has added thumbnails to their pages, if you enable them in preferences. It has become an issue, as NSFW thumbs can show up. I was thinking the other day, someone needs to do what you just did, which is create a way for a page to reference a thumbnail. I standard on the size needs to be developed.

    I am not sure I agree with your implementation, this seems more like meta data, and should be placed in a meta tag. You include width and height in your data as well, and I am not sure that is needed. Much like a favicon supports various bit depths, it is not explicitly stated in the meta link.

    I wonder if this is not more relevant, and wold not suffice:
    <meta name="thumbnail" content="url resource" />
  • AndyBeard · 11 months ago
    Not all images have a link to a full size image.
    No size standard should be used, every user is different

    Here are some alternatives

    1. A "thumbmap" which lists the images the author would like to be used for thumbnails in relation to posts
    2. Metadata - if internet giants can add meta just for owner validation, there is no problem using it to define which image to use for thumbs for a particular page.

    Sites are always picking the wrong image to create a thumb from

    I think meta is the most universal method for web pages, not sure about syndicated content
  • Harold Gilchrist · 11 months ago
    Wouldn't a new type of xml file best serve this problem?? Instead of tweeting a pointer to a html page you instead point to the media xml file that contains the media meta data. This would make it much more efficient for readers like Tweetree to parse the data .... and the xml file could be general enough to cover most media types ... and expandable to cover the future types. Remember you heard it here first!!!
  • pbump · 11 months ago
    Another note: PHP has a built in function to resize a JPG that would greatly facilitate the creation of these thumbnails, while preserving bandwidth.

    Yes, the quality suffers, but not prohibitively.
  • simeon · 11 months ago
    Maybe you're looking for oembed? It's a little more complicated (basically call a webservice url passing the url you're interested in and get back a snippet of json with some metainfo and media link.) Flickr and Hulu support it; I believe Cal Henderson at flickr wrote the spec...

    See http://oembed.com/ for details...
  • dave · 11 months ago
    That is interesting, it's overkill for my photos site -- I don't have a web service, and much prefer a static solution. But it still is interesting to see how they approached it. BTW, it's not just JSON, they also specify an XML interface.
  • simeon · 11 months ago
    My bad - I haven't ever implemented oembed but remembered Cal Henderson mentioning it in a video of a talk somewhere... I was thinking about discoverability (since you have to know the url that exposes the oembed service) and as I scroll down the oembed page I see they just use a link element in the head with the type specifying format+service (eg type="text/xml+oembed") with the url that will directly return the meta-info.

    That helps but I wonder if it there's a microformat for oembed so the content would be directly in the page instead of dependent on a second fetch...
  • Micah Alpern · 11 months ago
    Dave, have you seen the markup Facebook uses for sharing videos, images, etc.

    http://www.facebook.com/share_partners.php
  • chuckwh · 11 months ago
    XML rocks. Correctly done, always will, always should.
  • Brian Walsh · 11 months ago
    Wouldn't the mrss namespace be a perfect fit for this? It will also ease adoption, ensuring that systems built could use it for images as well as any other content (audio, video, et al) that has been embedded. http://search.yahoo.com/mrss
  • Justin Hart · 11 months ago
    This is great - is there anything like this in the microformats set yet? If not, make sure it gets added.

    So, the opposite should be available too: in an <img> tag, one should be able to say something like 'thumbs:thumbof src="http://example.org/myfile.jpg" thumbs:fulltype="image/jpeg" thumbs:fullwidth="1024" thumbs:fullheight="768"' - so a proper parser could come along and be able to get the full version for you if you choose (rightclick context menu, for example)
  • Justin Hart · 11 months ago
    err... realized obviously I just added extra attributes there... so some other format would need done, but you see what I intended.