Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Image Resizing

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Would appreciate some help with this one... I read the dynamically resize an image article at but for some reason the code does not work with my page!

my image code looks like this:
<img src=&quot;<%=(ResultsRecordset.Fields.Item(&quot;Image&quot;).Value)%>&quot;>
where the image paths are in the field &quot;Image&quot; in my database.

I suspect that the code might not work because the images that I want to resize are not on my server, they are being referenced from another website.

Thanks in advance,
Jonathan
 
I use a completely different approach:

First, my GIF and JPG are stored inside the table (I use a special wizard to avoid the bloating effect, this software automatically registers the dimensions of the pics as well)
Secondly I do an automatic FTP upload to the webserver.
When the pics are displayed (with binarywrite) the values for width and height are automatically read from the table record.
If I want to resize the pic I just multiply the dimensions with the factor I need, for example (sorry for the typos) how to double the size of the picture:

--- snip

dim someFactor ' as single
someFactor=2
HTMLCode = HTMLCode & &quot; width=&quot; & CINT(rs(pic_Width) * someFactor) & &quot; height = &quot; & CINT(rs(pic_Height) * someFactor) & &quot;>&quot;

--- snip
 
Ok, I thought I was getting the hang of the asp stuff, but HUH??? Can you walk me through that last script?
 
The ASP page reads the following information from the ACCESS recordset:

1. Binary data=picture
2. Dimensions (width and height)

When the picture is displayed and I want it only to have 75% of its original size I use a factor of 0.75 (multiply it with the original dimensions (width/height) and take only the Integer part of the result in consideration.
The factor can also be >1 but then, of course, the quality of the JPG or GIF will deteriorate.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top