Check file for instance of clipping path (name) in a pTIFF

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
limey2632
Posts: 2
Joined: 2015-07-29T15:28:25-07:00
Authentication code: 1151

Check file for instance of clipping path (name) in a pTIFF

Post by limey2632 »

Hi folks,
My question is about the ability of ImageMagick to read the existence of a path name (NORMALPATH) in a pTIFF/TIFF file?
I'm looking for a way for a utility written in C# to be able to check for the existence of a normal path named "path1" in a pTIFF file. Our programming department has provided us (production artists) with a utility that uploads our web images to the servers. We are uploading some files with paths and they have to be flagged in our system in order to be activated in the programming. we currently have to do this on an individual basis.

I am looking for a command line program that would identify the existence of the path or a way to have C# do it directly. Is ImageMagick right for the job? If so I will inform the company's programmers. Does anyone know of this kind of scripting being done? Sorry if this post is out of place but it is code related.

Many thanks,
Paul (Limey)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Check file for instance of clipping path (name) in a pTIFF

Post by fmw42 »

Typically the clip path will be in the identify -verbose yourimage.tif listing to the terminal as well as in the 8bim profile. See http://www.imagemagick.org/Usage/masking/#clip-path

If you have install IM already, see what gets returned from

Code: Select all

identify -format '%[8BIM:1999,2998:#1]' yourimage.tif
or just

Code: Select all

identify -verbose yourimage.tif
Otherwise, if you upload an example image to dropbox.com and put the URL here, some one here can look into it for you.


I have moved this to the Users forum, since I do not think this is related to Magick Scripting Language. It is also relevant to the Magick.Net forum, so dlemstra can move it there if he feels that is more relevant.
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Check file for instance of clipping path (name) in a pTIFF

Post by dlemstra »

At this moment this is not possible with in Magick.NET but you can get the names of the clipping paths with the following code in the next version of Magick.NET (7.0.0.0017)

Code: Select all

using (MagickImage image = new MagickImage("YourFile.tiff"))
{
  EightBimProfile profile = image.Get8BimProfile();
  foreach(ClipPath path in profile.ClipPaths)
  {
    Console.WriteLine(path.Name);
  }
}
I will try to publish a new release this weekend.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
limey2632
Posts: 2
Joined: 2015-07-29T15:28:25-07:00
Authentication code: 1151

Re: Check file for instance of clipping path (name) in a pTIFF

Post by limey2632 »

Thank you Dlemstra, much appreciated!

Paul (Limey)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Check file for instance of clipping path (name) in a pTIFF

Post by fmw42 »

dlemstra wrote:At this moment this is not possible with in Magick.NET but you can get the names of the clipping paths with the following code in the next version of Magick.NET (7.0.0.0017)

Please note that Dirk is referring to IM 7 and not IM 6.
Post Reply