This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, May 8, 2006 10:38:39 AM(UTC)
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
#2
Posted
:
Tuesday, May 9, 2006 1:23:12 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 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.