Page 1 of 1

UnsupportedPixelFormat status while using RemoveHolePunch method

Posted: Tue Sep 26, 2017 8:25 pm
by Anton
Hi,
I'm trying to use RemoveHolePunch on a colored 24 bit jpeg image but constantly gets UnsupportedPixelFormat return status. I tried to use this method on 1 bit image and worked fine.
In the documentation it is said that RemoveHolePunch can be used with 1, 8 and 24 bit per pixel image (see http://guides.gdpicture.com/content/web ... nt32).html).

Is it possible to use this method with colored image or may be I'm doing something wrong?

My C# code

Code: Select all

	    GdPictureImaging image = new GdPictureImaging();
            int imageId = image.CreateGdPictureImageFromFile(inputImage);
            if (imageId > 0)
            {
                image.ConvertTo24BppRGB(imageId);
                PixelFormat pf = image.GetPixelFormat(imageId); // px = PixelFormat.Format24bppRgb
                GdPictureStatus status = image.RemoveHolePunch(imageId);
                image.SaveAsJPEG(imageId, Path.Combine(OutputDirectory, $"{DateTime.Now.Ticks}.jpg"));
                image.ReleaseGdPictureImage(imageId);
            }

Re: UnsupportedPixelFormat status while using RemoveHolePunch method

Posted: Sun Oct 08, 2017 3:59 pm
by Loïc
Hi,

Are you on the latest release?

This feature has been introduced recently.

With best regards,

Loïc