Results 1 to 7 of 7

Thread: Create thumb of a BIG JPG with Javascript or ASP

  1. #1
    Join Date
    Apr 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post Create thumb of a BIG JPG with Javascript or ASP

    Hi there,

    i want to Create thumb of a BIG JPG/GIF... with Javascript or ASP with giving max-height and max-width - no losing much quality like resizing and giving it external links... like this:

    Code:
    imgsizer options: maxheight=100 / maxwidth=100
    
    <img src="http://www.oneothersite.com/a1.jpg" class="imgsizer">
    is that possible - is there any script doing that already?

    i prefer a free script ///

    Thanx in advance

    ps: Also i want to ask if there is any script that can encode my source on client's browser... Acctually when the user that viewing my html page will see a compressed and javascript encoded source...

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    You can resize images with JavaScript. This won't truly be creating a thumbnail and seems to me to be a complete bandwidth waste. ASP could handle such a thing though. This tutorial looks promising. I don't know ASP so I can't help more than that.

    Feel free to post in the ASP forum if you have trouble with that script.

    ps: Also i want to ask if there is any script that can encode my source on client's browser... Acctually when the user that viewing my html page will see a compressed and javascript encoded source...
    Such a script might exist, but it's 1000% useless to implement. So, I'd recommend not going down that route.

  3. #3
    Join Date
    Apr 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    @medyman
    first, i want to thank you answering parts of my question...
    but as i said the pictures are on external liks (third's site page), so as i see the asp code does not help me :-( because talking for local files....

    About the javascript - as you said will use the same bw (waste) but who cares... can javascript help me to give limits at images of external sites ?

    Thanx in advance..

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    but as i said the pictures are on external liks (third's site page), so as i see the asp code does not help me :-( because talking for local files....
    Have you tried just adding an absolute URI? It seems to be that there are security implications here but again, I don't know any ASP so I can't say if that's possible or not. Again, I'd refer you to the ASP forum where you might get a better answer.

    About the javascript - as you said will use the same bw (waste) but who cares... can javascript help me to give limits at images of external sites ?
    Well, you should care. But anyway, you won't get a true thumbnail with JavaScript. You can basically just resize an image. You can do this with CSS, so I don't see the point in using JavaScript here.

    You might want to look into using CSS clipping to create your thumbnail.

  5. #5
    Join Date
    Apr 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    i ve found this:

    LINK TO IT

    is the best solution - at the moment - but i am searching it for aspect ratio resizing...

    @medyman: asp is a server language not a client so - if use it i must download the picture (at server) and then making thumbnail - that is not a solution - i want on air solution simple and fast... as i said the images are at a remote servers...

  6. #6
    Join Date
    Apr 2008
    Posts
    27
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    and now i ve found with aspect ratio:

    Code:
      img.g10 {
    
      width: expression(Math.min(parseInt(this.offsetWidth), 40 ) + "px");
      height: auto;
      }

  7. #7
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by cyberd View Post
    and now i ve found with aspect ratio:

    Code:
      img.g10 {
    
      width: expression(Math.min(parseInt(this.offsetWidth), 40 ) + "px");
      height: auto;
      }
    That's IE only!

Bookmarks

Posting Permissions

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