Results 1 to 5 of 5
  1. #1
    Full Member
    Join Date
    January 18th, 2005
    Posts
    260
    Hotlinked Image Resizing
    Hi all,

    I'm using datafeeds from merchants that have only one size image, and that's the large one.. I call these remotely and then generate thumbnails on the fly from them.. Problem is the sizing..

    If I set absolute values (height & width) for the thumbnail, it distorts the image to match the dimensions.. If I just set only one, say height, I get the thumbnail in proportion, however the page takes forever to load (approx 30 seconds rather than 5 seconds for both absolute).. I have tried using GD to auto resize the images in proportion on the fly, however this also takes approx 30 seconds to load a page.. I also tried image caching with the GD but it was still sloooow.. At present the fastest loading (absolute) looks like crap (imaging a wine bottle pic at 100x100px ) , and the slow loading looks great..

    What options have others done to to get quick loading pages, but also display thumbnails in proportion? Is there any way I can do this at a hotlinked level?

  2. #2
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I usually check the merchant site for thumbnails and try to figure out what I need to do to the large image URL to find the thumbnail URL. Sometimes it's only a matter of adding a _t.jpg to the end of the image or swapping out /products with /thumbnails from the URL. This works 90% of the time. For the other 10% I either don't use the feed, use a "No Image Available" image or email the merchant and ask them to add thumbnails. If none of these are an option for you, you can write a script that will download all of the images with wget and resize them with GD behind the scenes. That way you'll have all the images stored on your server in the appropriate size.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  3. #3
    Full Member
    Join Date
    January 18th, 2005
    Posts
    260
    I had a look at grabbing the thumbnail urls but there is a fair whack of variation involved with the merchants.. I've decided to use wget as a solution for now..

  4. #4
    Member johnm's Avatar
    Join Date
    August 24th, 2005
    Location
    minneapolis
    Posts
    65
    Check for flash at the very start of your page. If the visitor has flash installed, instead of an img tag, use a very lightweight flash movie that takes an argument for a picture URL (from the server the flash movie was served from -- you will have to download the images) -- and have the movie resize and crop on the fly. If you want to get fancy, you can easily add function to your flash movie to blow the picture up or pan around in a smaller space (a la google maps). Cheers,
    John

    Quote Originally Posted by TK
    Hi all,

    I'm using datafeeds from merchants that have only one size image, and that's the large one.. I call these remotely and then generate thumbnails on the fly from them.. Problem is the sizing..

    If I set absolute values (height & width) for the thumbnail, it distorts the image to match the dimensions.. If I just set only one, say height, I get the thumbnail in proportion, however the page takes forever to load (approx 30 seconds rather than 5 seconds for both absolute).. I have tried using GD to auto resize the images in proportion on the fly, however this also takes approx 30 seconds to load a page.. I also tried image caching with the GD but it was still sloooow.. At present the fastest loading (absolute) looks like crap (imaging a wine bottle pic at 100x100px ) , and the slow loading looks great..

    What options have others done to to get quick loading pages, but also display thumbnails in proportion? Is there any way I can do this at a hotlinked level?

  5. #5
    ABW Ambassador FFoc's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,015
    If you use PHP, you can check the absolute size of the image and present an absolute thumb size to the user using a bit of math:
    PHP Code:
    // either:
    list($width$height$type$attr) = getimagesize("img/flag.jpg");
    // or:
    list($width$height$type$attr) = getimagesize("http://foobar.org/img/flag.jpg");
    // then:
    $aspectRatio $height $width ;
    echo 
    "<img src='image.jpg' height='150' width='" . ($aspectRatio 150) ."'>"
    .. or thereabouts.

    However, the better solution for your dialup users is to generate thumbs in advance, or find a source for them from your merchant, as you are still asking them to download the fullsize image.

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Need help resizing cj link image
    By echi in forum Commission Junction - CJ
    Replies: 13
    Last Post: February 13th, 2008, 02:08 AM
  2. Image resizing
    By burnden in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: December 31st, 2006, 10:56 PM
  3. Resizing an image when using product creater
    By purplebear in forum ShareASale - SAS
    Replies: 9
    Last Post: August 10th, 2006, 09:33 AM
  4. Resizing an image with WM-ImagePath tag
    By billbam in forum WebMerge (Fourthworld.com)
    Replies: 1
    Last Post: June 11th, 2004, 08:26 PM
  5. Hotlinked images...
    By weisinator in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: May 6th, 2004, 11:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •