473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Creating thumbnails

Ken
Hi all:
I have created a vb.net service that watches a directory and when an
image is placed in the directory a thumbnail of the image is created. The
problem I am having is a System.OutOfMemoryException: Out of memory. This
occurs after 1 or 2 thumbnails have been created. It looks as if the dispose
method is not working. I have created the thumbnails in a couple of different
ways but still get an error Invalid parameter used. After 1 or 2 thumbnails
have been created.
This problem does not exist when the service is on an xp machine. It
exists when placed on win 2000 server.

Here is the thumbnail function:

Public Function makeThumb(ByVal filePath As String, ByVal strThumbPath As
String, ByVal numArrayElement As Integer) As Boolean

Dim thePtr As System.IntPtr

Dim ObjTemp, testObj As System.Drawing.Image

Try
testObj = testObj.FromFile(filePath) '<---- error occurs here
ObjTemp = testObj.GetThumbnailImage(100, 100, AddressOf
ThumbNailAbort, thePtr)
ObjTemp.Save(strThumbPath, Drawing.Imaging.ImageFormat.Jpeg)

testObj.Dispose()
ObjTemp.Dispose()

'Force Garbage collection
System.GC.Collect()
System.GC.WaitForPendingFinalizers()

makeThumb = True
Catch ex As Exception
makeThumb = False
LogException("ServiceMedia Log", ex, EventLogEntryType.Error)
End Try
End Function

Any help would be appriciated.

Thanks
Jul 21 '05 #1
0 1198

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: John | last post by:
I am trying to create thumbnails from 2500 pictures. But I always get a Maximum execution time of 30 seconds exceeded" at the statement with the method with imagejpeg or imagedestroy after...
1
by: bob4roxio | last post by:
Is there any better quality method for creating resized images? I'm using imagecreatetruecolor and imagecopyresampled and making sure my imagejpeg quality is set at 100 but the client I'm writing...
4
by: sepgy | last post by:
Can anyone help me to use a python to create an HTML photo gallery generator. When it's finished, it will be able find all the picture files (i.e. .jpg, .gif. .png files) in any given folder on the...
2
by: James | last post by:
Hi, I'm a newbie to VB.NET and I am trying to create thumbnails from .jpg files (my travel pictures) to post on a website. I want to create an executable that I can put in a directory containing...
0
by: Ken | last post by:
Hi all: I have created a vb.net service that watches a directory and when an image is placed in the directory a thumbnail of the image is created. The problem I am having is a...
1
by: David Lozzi | last post by:
Hello, I'm wondering whats the best method to use for displaying several photos' thumbnails. One method I know is to dynamically resize the photo at the time the page is loaded. What does this...
2
by: Duane Phillips | last post by:
On image upload, I would like to save the image and also auto-create a right-size image for faster browsing, and also a thumbnail for indexes, so that slower connections do not have to wait for the...
8
by: ctiggerf | last post by:
I was hopeing someone could help me out here. Been stumped on this one all day. This function 1. Checks uploaded files. 2. Creates two resized images from each (a full size, and a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.