VintaSoft Imaging .NET SDK and Plug-ins Discussions
Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.
Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions
The process cannot access the file 'xxxx.tif' because it is being used by another process.Obviously I'd expect this if the thumbnail viewer had the file open - it doesn't and I make double sure by closeanddispose on it before calling the routine.
Using tif As New Vintasoft.Imaging.Codecs.Tiff.TiffFile(sourceFile, readOnlyAccess:=True)
For Each page In tif.Pages
If (page.BitsPerPixel) >= 24 Then
bCol = True
Exit For
End If
Next
End Using
I've also tried opening as a stream as follows but get the same. Using tif As New Vintasoft.Imaging.Codecs.Tiff.TiffFile(memstream)
For Each page In tif.Pages
If (page.BitsPerPixel) >= 24 Then
bCol = True
Exit For
End If
Next
End Using
In a desparate hack I even tried to copy to a temp file and use this for the test but again, makes not difference.Dim memStream As FileStream = New FileStream(sourceFile, FileMode.Open, FileAccess.Read)
Public Function ContainsColour2(ByVal sourceFile As String, Optional ByRef err As String = "", Optional fileStreamFile As FileStream = Nothing) As Boolean
Dim bCol As Boolean = False
Try
'
' // Do we have any colour pages
'
If sourceFile = String.Empty Then
Using tif As New Vintasoft.Imaging.Codecs.Tiff.TiffFile(fileStreamFile)
For Each page In tif.Pages
If (page.BitsPerPixel) >= 24 Then
bCol = True
Exit For
End If
Next
End Using
Else
Using tif As New Vintasoft.Imaging.Codecs.Tiff.TiffFile(sourceFile, readOnlyAccess:=True)
For Each page In tif.Pages
If (page.BitsPerPixel) >= 24 Then
bCol = True
Exit For
End If
Next
End Using
End If
Catch ex As Exception
Call ExceptionOccured(ex, True, False)
err = ex.Message
End Try
Return bCol
End Function
End Module