This project has moved. For the latest updates, please go here.

Detecting clipping paths in JPG

Jul 15, 2015 at 9:56 AM
I need to check if a JPG image has a clipping path or not. I have used the Interop.ImageMagick.dll earlier and then we used something like this:
MagickImage img = new MagickImage();

IList<object> parameters = new List<object>();
parameters.Add(@"-format");
parameters.Add(@"%[8BIM:2999,2999:#1]");
parameters.Add(sourceFilePath);

string clipPathInfo = img.Identify(parameters.ToArray()).ToString();
Is there a way to do this in in Magick.NET?
Coordinator
Jul 15, 2015 at 10:09 AM
Edited Jul 15, 2015 at 10:34 AM
Are you sure that you are using Magick.NET? There is no Identify method in the MagickImage class.

EDIT: Sorry, I did not see you posted the Interop syntax. You can do it like this:
using (MagickImage image = new MagickImage(sourceFilePath))
{
  string clipPathInfo = image.GetAttribute("8BIM:1999,2998:#1");
}
But I think this deserves a special property. I will add a new property called HasClippingPath in the next release.
Jul 15, 2015 at 10:35 AM
Edited Jul 15, 2015 at 10:36 AM
Thank you, that sounds great :)
Coordinator
Jul 15, 2015 at 10:35 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.