Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, May 8, 2006 10:43:39 AM(UTC)

gjdavis  
gjdavis

Groups: Registered
Posts: 3


Intermittently, the method below causes the following error in ASP.NET. 

"The process cannot access the file "somefile.gif" because it is being used by another process." 

At the time this method executes there are no other processes (that I know of) accessing the file.  The problem is occurring on a single-user development machine.

All I am trying to do is get an image of the first page of a PDF file and save it as a thumbnail in a gif file.  The problem does not occur every time, but it is recreatable.

Any advice appreciated.

-Grant

***************************************************

Friend Sub UpdateImageFiles()

'Semantics:

' Assuming the existance of a PDF file for this raw file page, create/overwrite the image file

' used in tagging.

Dim codecs As New Leadtools.Codecs.RasterCodecs

Dim image As Leadtools.IRasterImage

Dim resizeCommand As New Leadtools.ImageProcessing.ResizeCommand

'Load the PDF file

image = codecs.Load(PDFPath)

resizeCommand.Flags = RasterSizeFlags.Normal

resizeCommand.DestinationImage = New RasterImage(RasterMemoryFlags.Managed, _

image.Width / SMALL_IMAGE_RATIO, _

image.Height / SMALL_IMAGE_RATIO, _

image.BitsPerPixel, _

image.Order, _

image.ViewPerspective, _

image.Palette, _

Nothing)

resizeCommand.Run(image)

File.Delete(SmallImagePath)

codecs.Save(resizeCommand.DestinationImage, SmallImagePath, RasterImageFormat.Gif, 0, 1, 1, 1, _

CodecsSavePageMode.Overwrite)

codecs = Nothing

resizeCommand = Nothing

image.Dispose()

image = Nothing

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, May 9, 2006 1:28:12 AM(UTC)

Bashar  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 post(s)

To my understanding, you run the code repeatedly overwriting the same
GIF file.  Try deleting the file (if it exists) before
saving.  Also, you might want to try the latest patch for v14 or
14.5 .NET (depending on the version you have) and see if that changes anything.

 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.106 seconds.