Loading ...
Sorry, an error occurred while loading the content.

Image thumbnails, URIs and content negotiation

Expand Messages
  • Stefano Masini
    Hello, how would you model an image archive where the client could retrieve: - images in their original format - thumbnails in different size (small, medium,
    Message 1 of 7 , Jul 3, 2008
    • 0 Attachment
      Hello,

      how would you model an image archive where the client could retrieve:
      - images in their original format
      - thumbnails in different size (small, medium, large)

      I initially thought about a url scheme such as the following. Respectively:
      - /images/<imageid>
      - /images/<imageid>/thumbnails/<size> (where <size> is "small",
      "medium" or "large")

      But then, on second thoughs, I considered the principle of content
      negotiation: should I consider a thumbnail just as a different
      representation of the same image? In this case I should probably use
      the sare URL for both cases, and specify a different Accept header.
      In the latter scenario though, I wouldn't be able to easily build an
      html page showing thumbnails, because html <img> tag simply doesn't
      allow to specify request headers in the "src" attribute, but simply a
      url.

      Maybe I just answered myself, but I was wondering if anybody had an
      opinion (or better yet, experience) on this matter.

      Thanks
      Stefano
    • Sebastien Lambla
      I model /image/2 to represent the image resource, and each resolution that exists as an individual document gets its own url too at /image/2/{format} By
      Message 2 of 7 , Jul 3, 2008
      • 0 Attachment
        I model /image/2 to represent the image resource, and each resolution that exists as an individual document gets its own url too at /image/2/{format}
         
        By default the /image/2 does a 300 with /image/2/thumbnail, /image/2/screen and /image/2/original for most content-type requests, for an image specific one i 303 to /image/2/screen automatically.
         
        Seb






        > To: rest-discuss@yahoogroups.com
        > From: stefano.masini@...
        > Date: Thu, 3 Jul 2008 09:46:20 +0200
        > Subject: [rest-discuss] Image thumbnails, URIs and content negotiation
        >
        > Hello,
        >
        > how would you model an image archive where the client could retrieve:
        > - images in their original format
        > - thumbnails in different size (small, medium, large)
        >
        > I initially thought about a url scheme such as the following. Respectively:
        > - /images/<imageid>
        > - /images/<imageid>/thumbnails/<size> (where <size> is "small",
        > "medium" or "large")
        >
        > But then, on second thoughs, I considered the principle of content
        > negotiation: should I consider a thumbnail just as a different
        > representation of the same image? In this case I should probably use
        > the sare URL for both cases, and specify a different Accept header.
        > In the latter scenario though, I wouldn't be able to easily build an
        > html page showing thumbnails, because html <img> tag simply doesn't
        > allow to specify request headers in the "src" attribute, but simply a
        > url.
        >
        > Maybe I just answered myself, but I was wondering if anybody had an
        > opinion (or better yet, experience) on this matter.
        >
        > Thanks
        > Stefano
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        > <*> To visit your group on the web, go to:
        > http://groups.yahoo.com/group/rest-discuss/
        >
        > <*> Your email settings:
        > Individual Email | Traditional
        >
        > <*> To change settings online go to:
        > http://groups.yahoo.com/group/rest-discuss/join
        > (Yahoo! ID required)
        >
        > <*> To change settings via email:
        > mailto:rest-discuss-digest@yahoogroups.com
        > mailto:rest-discuss-fullfeatured@yahoogroups.com
        >
        > <*> To unsubscribe from this group, send an email to:
        > rest-discuss-unsubscribe@yahoogroups.com
        >
        > <*> Your use of Yahoo! Groups is subject to:
        > http://docs.yahoo.com/info/terms/
        >



        Play interactive Live Search Charades Are you the top Charades player?
      • Lawrence Oluyede
        On Thu, Jul 3, 2008 at 9:46 AM, Stefano Masini ... I d look at what flickr does for its tons of images in different sizes: You can see here
        Message 3 of 7 , Jul 3, 2008
        • 0 Attachment
          On Thu, Jul 3, 2008 at 9:46 AM, Stefano Masini
          <stefano.masini@...> wrote:
          > Maybe I just answered myself, but I was wondering if anybody had an
          > opinion (or better yet, experience) on this matter.

          I'd look at what flickr does for its tons of images in different sizes:

          You can see here
          http://www.flickr.com/services/api/flickr.photos.getSizes.html (and in
          any photo page) that the images are represented in various sizes.
          It uses /s, /m for the pages of the various sizes and _s.jpg, _m.jpg
          for the image itself.

          HTH


          --
          Lawrence, stacktrace.it - oluyede.org - neropercaso.it
          "It is difficult to get a man to understand
          something when his salary depends on not
          understanding it" - Upton Sinclair
        • Subbu Allamaraju
          Conneg could be used for this use case for non-HTML clients. However, conneg is based on each of these representations having a different media type, and you
          Message 4 of 7 , Jul 3, 2008
          • 0 Attachment
            Conneg could be used for this use case for non-HTML clients. However,
            conneg is based on each of these representations having a different
            media type, and you will need some extension to let the client
            negotiate.

            On Jul 3, 2008, at 12:46 AM, Stefano Masini wrote:

            > Hello,
            >
            > how would you model an image archive where the client could retrieve:
            > - images in their original format
            > - thumbnails in different size (small, medium, large)
            >
            > I initially thought about a url scheme such as the following.
            > Respectively:
            > - /images/<imageid>
            > - /images/<imageid>/thumbnails/<size> (where <size> is "small",
            > "medium" or "large")
            >
            > But then, on second thoughs, I considered the principle of content
            > negotiation: should I consider a thumbnail just as a different
            > representation of the same image? In this case I should probably use
            > the sare URL for both cases, and specify a different Accept header.
            > In the latter scenario though, I wouldn't be able to easily build an
            > html page showing thumbnails, because html <img> tag simply doesn't
            > allow to specify request headers in the "src" attribute, but simply a
            > url.
            >
            > Maybe I just answered myself, but I was wondering if anybody had an
            > opinion (or better yet, experience) on this matter.
            >
            > Thanks
            > Stefano
            >
            >
          • Aristotle Pagaltzis
            ... Don’t forget that there is no reason you cannot do both. Regards, -- Aristotle Pagaltzis //
            Message 5 of 7 , Jul 3, 2008
            • 0 Attachment
              * Stefano Masini <stefano.masini@...> [2008-07-03 09:50]:
              > I initially thought about a url scheme such as the following.
              > […] But then, on second thoughs, I considered the principle of
              > content negotiation

              Don’t forget that there is no reason you cannot do both.

              Regards,
              --
              Aristotle Pagaltzis // <http://plasmasturm.org/>
            • Sebastien Lambla
              I wonder if extensions to a mime type in this instance would be allowed? Provided the server is implemented correctly, requesting image/jpeg;size=medium should
              Message 6 of 7 , Jul 4, 2008
              • 0 Attachment
                I wonder if extensions to a mime type in this instance would be allowed? Provided the server is implemented correctly, requesting image/jpeg;size=medium should still work. THat's an approach I didn't think of, but I like it.




                > To: rest-discuss@yahoogroups.com
                > From: pagaltzis@...
                > Date: Thu, 3 Jul 2008 17:23:51 +0200
                > Subject: [rest-discuss] Re: Image thumbnails, URIs and content negotiation
                >
                > * Stefano Masini <stefano.masini@...> [2008-07-03 09:50]:
                > > I initially thought about a url scheme such as the following.
                > > […] But then, on second thoughs, I considered the principle of
                > > content negotiation
                >
                > Don’t forget that there is no reason you cannot do both.
                >
                > Regards,
                > --
                > Aristotle Pagaltzis // <http://plasmasturm.org/>
                >
                > ------------------------------------
                >
                > Yahoo! Groups Links
                >
                > <*> To visit your group on the web, go to:
                > http://groups.yahoo.com/group/rest-discuss/
                >
                > <*> Your email settings:
                > Individual Email | Traditional
                >
                > <*> To change settings online go to:
                > http://groups.yahoo.com/group/rest-discuss/join
                > (Yahoo! ID required)
                >
                > <*> To change settings via email:
                > mailto:rest-discuss-digest@yahoogroups.com
                > mailto:rest-discuss-fullfeatured@yahoogroups.com
                >
                > <*> To unsubscribe from this group, send an email to:
                > rest-discuss-unsubscribe@yahoogroups.com
                >
                > <*> Your use of Yahoo! Groups is subject to:
                > http://docs.yahoo.com/info/terms/
                >


                Find out how to make Messenger your very own TV! Try it Now!
              • Aristotle Pagaltzis
                ... The registration of each MIME type specifies the parameters you may attach to it. You can’t make up new ones willy nilly. Regards, -- Aristotle Pagaltzis
                Message 7 of 7 , Jul 5, 2008
                • 0 Attachment
                  * Sebastien Lambla <seb@...> [2008-07-04 15:20]:
                  > I wonder if extensions to a mime type in this instance would be
                  > allowed? Provided the server is implemented correctly,
                  > requesting image/jpeg;size=medium should still work. THat's an
                  > approach I didn't think of, but I like it.

                  The registration of each MIME type specifies the parameters you
                  may attach to it. You can’t make up new ones willy nilly.

                  Regards,
                  --
                  Aristotle Pagaltzis // <http://plasmasturm.org/>
                Your message has been successfully submitted and would be delivered to recipients shortly.