使用c#将Adobe Image Resource Block元数据写入tiff图像

时间:2014-03-09 03:59:27

标签: c# image metadata tiff

我在Adobe论坛上发布了这个问题,但没有得到任何解决方案。好吧,这就是..

背景:

我正在开发一个小型.NET应用程序,它读取tiff文件并对其执行一些与元数据相关的操作。 该程序适用于从photoshop中获取的所有tiff图像。我收到了客户端的tiff文件,该文件不能与该程序一起使用。 我使用imagemagik检查了文件的元数据信息,以下是输出

 
  Format: TIFF (Tagged Image File Format)
  Mime type: image/tiff
  Class: DirectClass
  Geometry: 6986x3754+0+0
  Resolution: 96x96
  Print size: 72.7708x39.1042
  Units: PixelsPerInch
  Type: TrueColorAlpha
  Base type: TrueColor
  Endianess: MSB
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 8-bit
  Channel statistics:
    Red:
      min: 37 (0.145098)
      max: 255 (1)
      mean: 215.041 (0.843299)
      standard deviation: 48.8483 (0.191562)
      kurtosis: 0.845012
      skewness: -1.09632
    Green:
      min: 25 (0.0980392)
      max: 255 (1)
      mean: 213.399 (0.836859)
      standard deviation: 50.853 (0.199424)
      kurtosis: 0.908226
      skewness: -1.09806
    Blue:
      min: 21 (0.0823529)
      max: 255 (1)
      mean: 210.495 (0.825471)
      standard deviation: 53.6527 (0.210403)
      kurtosis: 0.124965
      skewness: -0.929882
    Alpha:
      min: 64 (0.25098)
      max: 255 (1)
      mean: 254.948 (0.999796)
      standard deviation: 2.56957 (0.0100768)
      kurtosis: 2437.44
      skewness: 49.3893
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 159.747 (0.626458)
      standard deviation: 44.321 (0.173808)
      kurtosis: 48.4205
      skewness: -8.00071
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 6986x3754+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: LZW
  Orientation: TopLeft
  Properties:
    date:create: 2014-02-15T21:18:37+06:00
    date:modify: 2014-02-09T16:29:10+06:00
    signature: a5c4a9415437ee2d3b0c3d860b30c5367f73fe7553c3f54923caf6da4b9e4623
    tiff:alpha: unassociated
    tiff:endian: lsb
    tiff:photometric: RGB
    tiff:rows-per-strip: 3754
  Artifacts:
    filename: C:\Users\Jane\TiffPathOperation\bin\Debug\Example1client_no_path.tiff
    verbose: true
  Tainted: False
  Filesize: 14.6MB
  Number pixels: 26.23M
  Pixels per second: 54.64MB
  User time: 0.484u
  Elapsed time: 0:01.479
  Version: ImageMagick 6.8.7-4 2013-10-26 Q16 http://www.imagemagick.org


Unlike other tiff images this image does not contain 8bim profile information, which is required for proper execution of the program

Profiles:
  Profile-8bim: 11720 bytes
  Profile-icc: 3144 bytes
    Description: sRGB IEC61966-2.1
    Manufacturer: IEC http://www.iec.ch
    Model: IEC 61966-2.1 Default RGB colour space - sRGB
    Copyright: Copyright (c) 1998 Hewlett-Packard Company
  Profile-xmp: 19368 bytes

可能的解决方案: 我必须将Image资源块数据添加到缺少配置文件信息的图像中。

问题: 我将不得不为Adobe规范中列出的资源ID编写标签34377的元数据 我怎么想写这整个块并将其分配给C#中的Tag 34377? 应为每个资源ID添加哪些值?

Tiff图片:http://1drv.ms/NtzbCr

0 个答案:

没有答案