473,385 Members | 1,326 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,385 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 1201

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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.