|
-
Oct 6th, 2004, 10:17 PM
#1
Thread Starter
Fanatic Member
Thumb preview
Allright, I have a directory in my web project that has a whole bunch of pictures. They are quite large. The pictures are of products the site will be selling, so I will need a large view of the picture if a customer decides to click on it.
Problem is, if I use the current pictures, which are 100k each (200x200), for my main product display, thesite loads slow. Since even if i make the <IMG WIDTH and LENGTH> small, the site still loads the entire picture.
So.. is there a way to generate a preview picture first from the original? Right now its not possible to take every picture into photoshop and downsize them and shrink them and upload them again.. and etc etc...
I will need to use the originals. Any idea?
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Oct 7th, 2004, 04:09 AM
#2
How ever you do it, its not gonna be easy.
You could probably download component to generate thumbnail on the fly, but that will be slow if you have quite a lot of images.
My suggestion would be to use a batch converter and resize them to a smaller size. This will be much efficient then any other ways.
Hope it helps.
Danial
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Oct 8th, 2004, 10:16 AM
#3
Thread Starter
Fanatic Member
ugh.. and just when i thought it was gonna be going downhill 
Thanks for the reply D,
Batch convertor? I never used anything like this, mind explainig in more detail?
Also, the pictures are still being uploaded through ASP Upload. I would like the new ones that are being uploaded also shrunk down. So if there is a way where the upladed image can be split into two images (image1 and image1small) that would be great.
I don't think ASP upload has any of those options. Jodohosthas a component called ASP Image.. any ideas on what that is?
I'll do my research when I get home tonight, no time at work.
Thanks Danial
ok, so... windows takes 1 minute to search for a file on my PC yet google.com takes 1 second to search the entire internet? 
-
Oct 9th, 2004, 05:33 PM
#4
For the benfit of people reading this thread you could achieve what Invitro wanted using combination of two component from Persist(Both free) called AspUpload and AspJpeg.
I knew about AspUpload but didnt know AspJpeg existed until i spoke to Invitro, so thank him if it came to any use for you.
Here is the link http://www.aspupload.com/
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Oct 22nd, 2007, 11:30 AM
#5
Junior Member
Re: Thumb preview
I had the same problem and solved it with the help of this tutorial, plus i modified the image grabber routine from the tutorial, so it looks like this:
Code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim ds As New Data.DataSet
Dim da As New SqlDataAdapter
Dim arrContent, slika As Byte()
Dim dr As Data.DataRow
Dim pic, thumb As System.Drawing.Image
Dim width, height, size As Integer
Dim SQL As String = "select * from imgs where imgId=" & Request.QueryString("ID")
Dim connString As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=""|DataDirectory|\imgDB.mdf"";Integrated Security=True;User Instance=True"
da = New SqlDataAdapter(SQL, connString)
da.Fill(ds)
dr = ds.Tables(0).Rows(0)
arrContent = CType(dr.Item("imgData"), Byte())
Dim conType As String = dr.Item("imgType").ToString
'making the thumbnail
Dim stream As New System.IO.MemoryStream(arrContent)
pic = System.Drawing.Image.FromStream(stream)
width = 100
height = pic.Height / (pic.Width / 100)
thumb = pic.GetThumbnailImage(width, height, Nothing, System.IntPtr.Zero)
stream.Dispose()
pic.Dispose()
Using str As New System.IO.MemoryStream
thumb.Save(str, System.Drawing.Imaging.ImageFormat.Jpeg)
slika = str.GetBuffer
size = str.Length
End Using
thumb.Dispose()
Response.ContentType = conType
Response.OutputStream.Write(slika, 0, size)
Response.End()
Catch ex As Exception
End Try
End Sub
hope it helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|