I have encountered an issue with the GdPicture pro control within an VB.net application. We are using the active X control.
When we are using the control to convert to lo-res the then watermark a large quantity of images, which works fine when we use a folder of images on local drives.
The steps we take are:
1) We create an instance of the GdPicture control,
img = CreateObject("GdPicturePro5.Imaging")
img = New GdPicturePro5.Imaging
2) Loop through the list of images we want to convert and watermark
3) With each image, we set the rotation of the image (depending on the orientation Exif data)
For lCount = 1 To img.ExifTagCount
If img.ExifTagGetName(lCount) = "Orientation" Then
Select Case Trim(img.ExifTagGetValueString(lCount))
Case "1" 'None
lRotation = 0
Case "8" 'Right 90
lRotation = 270
Case "3" 'Right 180
lRotation = 180
Case "6" 'Right 270
lRotation = 90
End Select
Exit For
End If
Next lCount
4) Convert the image to lo-res, then rotate as necessary
img.ResizeHeightRatio(lLoResSize, lConversionMode)
Select Case lRotation
Case 90
img.Rotate(GdPicturePro5.RotateFlipType.Rotate90FlipNone)
Case 180
img.Rotate(GdPicturePro5.RotateFlipType.Rotate180FlipNone)
Case 270
img.Rotate(GdPicturePro5.RotateFlipType.Rotate270FlipNone)
End Select
5) Write the watermark then save the file
img.FontSetUnit(GdPicturePro5.UnitMode.UnitPixel)
img.DrawText("Watermark Text", lXPos, lYPos, lFontSize, GdPicturePro5.FontStyle.FontStyleBoldItalic, 1021765350, "Verdana", True)
img.SaveAsJPEG(sLoFileName, 85)
Doing this works fine if we are using local drive files (i.e. C:\Images)
When we do this against a mapped drive (against a network drive), the end result is that the image will be resized/rotated, but no watermark will appear!
I have a workaround, in that I save the the image temporarily after it is resized/rotated, then I load the temporary image before drawing the watermark. This is not ideal, as we will be processing thousands of images a day, and saving thousands of temporary files (then having to delete them) is utilising system resources unnecessarily.
Is this an known issue, that we need to workaround? Or is there a proper fix for this available?
Many thanks for any advice
Kin
