Page 1 of 1

TIFF to TIFF convert doesn't keep custom tag

Posted: 2012-10-03T17:47:01-07:00
by arnoques
I'm re-posting this question as a bug since it looks like it isn't the intended behavior.

I'm trying to compress many tiff images to save some space. I'm using

Code: Select all

convert Q32_cm4989.tif -compress Zip Q32_cm4989_zip.tif
with ImageMagick 6.7.7-10 2012-08-27 Q16 (Features: OpenMP) in Debian testing.

The problem is that convert strips the proprietary tag 34118 (which I need, since it has lots of info). The original image can be downloaded here. I'm posting all the information I can about the images.

Code: Select all

identify -verbose Q32_cm4989.tif
Image: Q32_cm4989.tif
  Format: TIFF (Tagged Image File Format)
  Class: PseudoClass
  Geometry: 1024x768+0+0
  Resolution: 1x1
  Print size: 1024x768
  Units: Undefined
  Type: Palette
  Base type: Palette
  Endianess: MSB
  Colorspace: sRGB
  Depth: 16-bit
  Channel depth:
    red: 16-bit
    green: 16-bit
    blue: 16-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
    Green:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
    Blue:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
  Colors: 250
  Histogram:
(snipped)
  Colormap: 256
(snipped)
  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)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 1024x768+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: None
  Orientation: TopLeft
  Properties:
    date:create: 2012-03-02T09:23:19-03:00
    date:modify: 2009-12-15T14:52:28-03:00
    signature: 0dae07722bd09fafb3f2605d56c1b76e616e1a4e2469bfda0519d95e9735b03e
    tiff:endian: lsb
    tiff:photometric: palette
    tiff:rows-per-strip: 8
  Artifacts:
    filename: Q32_cm4989.tif
    verbose: true
  Tainted: False
  Filesize: 799KB
  Number pixels: 786K
  Pixels per second: 39.32MB
  User time: 0.010u
  Elapsed time: 0:01.019
  Version: ImageMagick 6.7.7-10 2012-08-27 Q16 http://www.imagemagick.org

Code: Select all

tiffinfo Q32_cm4989.tif
TIFF Directory at offset 0x8 (8)
  Subfile Type: (0 = 0x0)
  Image Width: 1024 Image Length: 768
  Resolution: 1, 1 (unitless)
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: palette color (RGB from colormap)
  Samples/Pixel: 1
  Rows/Strip: (infinite)
  Planar Configuration: single image plane
  Color Map: (present)
  Tag 34118: 0
0
0
1.464848e-009
2.000000e+005
5
4.000000e+003
2.390000e+000
2.000000e-007
3.326695e-003
1
1.464848e-009
2.000000e+005
5
4.000000e+003
2.390000e+000
2.000000e-007
3.326695e-003
2
1.464848e-009
2.000000e+005
5
4.000000e+003
2.390000e+000
2.000000e-007
3.326695e-003
3
1.464848e-009
2.000000e+005
5
4.000000e+003
2.390000e+000
2.000000e-007
3.326695e-003
285
DP_NEWFILAMENT
New Filament = No
DP_ZOOM
Zoom = Off
DP_APERTURE
Aperture No. = 1
DP_DYNFOCUS
Dyn.Focus = Off
DP_BEAM_BLANKED
Beam Blanked = Yes
DP_STAGE_IS
Stage Is = Idle
DP_STAGE_INIT
Stage Initialised = Yes
DP_OUT_DEV
Output dev = 17 inch display
DP_PIXEL_SIZE
Pix Size state = calibrated
DP_EHT_VAC_READY
EHT Vac ready = Yes
DP_LINE_SCAN
Line Scan = Off
DP_SPOT
Spot = Off
DP_WINDOWING
Windowing = Off
DP_VENT_INHIBITED
Venting inhibited = Yes
DP_4QBSD_GAIN
BSD Gain = Low
DP_4QBSD_VISIBLE
BSD Fast = No
DP_4QBSD_Q4
Q4 = Off
DP_4QBSD_Q3
Q3 = Off
DP_4QBSD_Q2
Q2 = Off
DP_4QBSD_Q1
Q1 = Off
DP_AUTO_VIDEO
Auto BC = Off
DP_INVERT
Invert A = Off
DP_MIXING
Mixing = Off
DP_DETECTOR_CHANNEL
Signal A = InLens
DP_ZONE
Zone = 0
DP_IMAGE_STORE
Store resolution = 1024 * 768
DP_STAGE_TILTED
Stage Tilt = in X
DP_Z1
Zone 1 = Frozen
DP_Z0
Zone 0 = Frozen
DP_FREEZE_STATUS
Freeze = Idle
DP_FREEZE_ON
Freeze on = End Frame
DP_CHANNEL
Display = Left
DP_RIGHT_FROZEN
Right Frozen = Yes
DP_TILTED
Stage Tilted = No
DP_VENT_INVALID_REASON
Vent inhibit = Beam Present
DP_SCINT
Scint. = On
DP_SCAN_ROT
Scan Rot = On
DP_TILT_CORRECTION
Tilt Corrn. = Off
DP_IMPLIED_INVERT
Invert B = Off
DP_IMPLIED_DETECTOR
Signal B = InLens
DP_MAIN_DETECTOR
Control = Signal A
DP_COLUMN_ISOLATED
Column Isolated = No
DP_SCM_RANGE
SCM range = 3->10 pA
DP_EXT_SCAN_CONTROL
Ext.Scan Control = Off
DP_ALL_ZONES
All Zones = Off
DP_MAG_RANGE
Mag Range = 3
DP_LOW_MAG
Low Mag = Off
DP_FROZEN
Image = Frozen
DP_LUT_MODE
Display LUT mode = Normal
DP_FREEZE_BLANKS
Freeze Blanks = Yes
DP_IMAGE_DETECT
Image Detect = Black
DP_CROSSHAIRS
Crosshairs = Off
DP_TRACK_Z
Track Z = On
DP_SEM
Sem = Supra 40
DP_USER_MAG_CAL
User Calibration = On
DP_INPUT_LUT_MODE
Input LUT Mode = Transparent
DP_DWELL_TIME
Dwell Time = 100 ns
DP_USER
User = Idle
DP_SCM_STATUS
SCM Status = Valid
DP_USE_REF_MAG
Reference Mag = Out Dev.
DP_BSD_AUTO
BSD Auto Range = Off
DP_ELECTRON_COUNTING
Electron Counting = Off
DP_HIGH_CURRENT
High Current = Off
DP_DUAL_MONITOR
Dual Monitor = Off
DP_MAINS_SYNC
Mains Sync = Single Edge
DP_FAST_MODE
Fast Mode = Off
DP_IMAGE_SAVED
Image saved = Yes
DP_STEM_AUTO
STEM Auto = Off
DP_STEM_GAIN
STEM Gain = Low
DP_STEM_FAST
STEM Fast = No
DP_STEM_Q3
STEM Q3 = Off
DP_STEM_Q2
STEM Q2 = Off
DP_STEM_Q1
STEM Q1 = Off
DP_LARGE_BEAMSHIFT
Large Beam Shift = Off
DP_USER_LEVEL
User Level = Expert
DP_QUATTRO_BANDWIDTH
BSD Bandwidth = DC
DP_USER_ALIGN
User Align = On
DP_COLOUR_MODE
Colour Mode = Off
DP_RECIPE
Recipe = Idle
DP_SI_NOISE_REDUCTION
SmartImage Noise Reduction = Off
DP_BSD_FAST_SCAN
BSD Fast Scan = Off
DP_SCD_BANDWIDTH
SCD Bandwidth = DC
DP_SCD_AUTO
SCD Auto Range = Off
DP_SCD_GAIN
SCD Gain = Low
DP_OPTIPROBE
OptiProbe = Off
DP_RUNUPSTATE
Beam State = Beam On
DP_OPERATING_MODE
Operating Mode = Normal
DP_SCANRATE
Scan Speed = 1
DP_VACSTATUS
Vac Status = Ready
DP_COLUMN_PUMPING
Column pumping = Ready
DP_NOISE_REDUCTION
Noise Reduction = Frame Avg
DP_LEFT_FROZEN
All Frozen = Yes
DP_OUT_TYPE
Output To = Display/File
AP_C3
C3 Lens I = 950.56 mA
AP_SCANROTATION
Scan Rotation =   0.0 °
AP_WD
WD =  3.3 mm
AP_MAG
Mag = 200.00 K X
AP_BRIGHTNESS
Brightness =  48.7 %
AP_MANUALKV
EHT Target =  4.00 kV
AP_IPROBE
I Probe =  200.0 nA
AP_FRAME_TIME
Cycle Time = 978.00 ms
AP_TILT_ANGLE
Tilt Angle =   0.0 °
AP_TILT_AXIS
Tilt Axis =  90.0 °
AP_STIG_X
Stigmation X =   4.0 %
AP_APERTURESIZE
Aperture Size = 30.00 µm
AP_BEAMSHIFT_Y
Beam Shift Y =  41.8 %
AP_BEAMSHIFT_X
Beam Shift X = -87.8 %
AP_RED_RASTER_H
Red.Raster Height = 384   
AP_RED_RASTER_W
Red.Raster Width = 512   
AP_RED_RASTER_POSN_Y
Red.Raster Posn Y = 192   
AP_RED_RASTER_POSN_X
Red.Raster Posn X = 256   
AP_ZOOM_FACTOR
Zoom factor =  2.000
AP_STIG_Y
Stigmation Y =  -1.7 %
AP_PPB_3
Pb 4 =   0.0 °
AP_PPB_2
Pb 3 =   0.0 °
AP_PPB_1
Pb 2 =   0.0 °
AP_PPB_0
Pb 1 =   0.0 °
AP_PPA_3
Pa 4 = 0.00 nm
AP_PPA_2
Pa 3 = 0.00 nm
AP_PPA_1
Pa 2 = 0.00 nm
AP_PPA_0
Pa 1 = 0.00 nm
AP_RADIAL_3
Da 4 = 0.00 nm
AP_RADIAL_2
Da 3 = 0.00 nm
AP_RADIAL_1
Da 2 = 0.00 nm
AP_RADIAL_0
Da 1 = 0.00 nm
AP_ANGULAR_1
Aa 2 =   0.0 °
AP_ANGULAR_0
Aa 1 =   0.0 °
AP_STAGE_FIELDS_Y
Stage fields Y = 1     
AP_STAGE_FIELDS_X
Stage fields X = 1     
AP_STAGE_GOTO_Z
Stage goto Z = 17.077 mm
AP_STAGE_GOTO_Y
Stage goto Y = 19.555 mm
AP_STAGE_GOTO_X
Stage goto X = 29.451 mm
AP_PROFILE_W
Profile width = 0.00 nm
AP_PIXEL_SIZE
Pixel Size = 1.5 nm
AP_COLUMN_VAC
Gun Vacuum = 9.80e-010 mbar
AP_SYSTEM_VAC
System Vacuum = 2.56e-006 mbar
AP_STAGE_LOW_Z
Stage low Z =  0.000 mm
AP_STAGE_LOW_Y
Stage low Y =  0.000 mm
AP_STAGE_LOW_X
Stage low X =  0.000 mm
AP_STAGE_HIGH_Z
Stage high Z = 25.000 mm
AP_STAGE_HIGH_Y
Stage high Y = 75.000 mm
AP_STAGE_HIGH_X
Stage high X = 75.000 mm
AP_STAGE_AT_FIELD_Y
Stage at field Y = 1     
AP_STAGE_AT_FIELD_X
Stage at field X = 1     
AP_STAGE_GOTO_FIELD_Y
Stage goto field Y = 1     
AP_STAGE_GOTO_FIELD_X
Stage goto field X = 1     
AP_STAGE_FIELD_SIZE_Y
Stage field size Y =  0.000 mm
AP_STAGE_FIELD_SIZE_X
Stage field size X =  0.000 mm
AP_CONTRAST
Contrast =  25.3 %
AP_OFFSET
Offset A =   0.0 %
AP_GAIN
Gain A = 100.0 %
AP_GAMMA
Gamma =  1.000
AP_LINE_INT_COUNT
Line int. count = 1     
AP_FRAME_INT_COUNT
Frames to Int. = 0     
AP_FRAME_AVERAGE_COUNT
Frames to average = 8     
AP_K2
Mix Signal = 0.0000
AP_K1
Signal =  1.000
AP_SCM
Specimen I =  -2.14 µA
AP_MAG1
Mag Z1 =  1.000
AP_MAG0
Mag Z0 =  1.000
AP_COLLECTOR_BIAS
Collector Bias =     0 V
AP_IMPLIED_OFFSET
Offset B =   0.0 %
AP_IMPLIED_GAIN
Gain B = 100.0 %
AP_FILAMENT_AGE
Filament Age = 3130.52 Hours
AP_BEAM_OFFSET_Y
Beam Offset Y = 3.894 µm
AP_BEAM_OFFSET_X
Beam Offset X = -8.03  µm
AP_HEIGHT
Height = 1.125 µm
AP_WIDTH
Width = 1.500 µm
AP_ALIAS_WD
Focus =  3.3 mm
AP_MINMAG
Min Mag =     77 X
AP_NR_COEFF
N = 8     
AP_LINE_AVERAGE_COUNT
Line Avg.Count = 1     
AP_PHOTO_NUMBER
Photo No. = 2412  
AP_FIELD_OVERLAP
Field Overlap =   0.0 %
AP_MIN_WD
Focus scan min =    1 mm
AP_MAX_WD
Focus scan max =   40 mm
AP_AREA_FRACTION
Area Fraction =   0.0 %
AP_WHITE_DETECT
White Threshold = 100.0 %
AP_BLACK_DETECT
Black Threshold =   0.0 %
AP_STAGE_GOTO_T
Stage goto T =   0.0 °
AP_STAGE_GOTO_R
Stage goto R = 264.4 °
AP_BEAM_TIME
Beam Time = 613.23 Hours
AP_EXTCURRENT
Extractor I = 192.80 µA
AP_MANUALEXT
Extractor V Target =  5.00 kV
AP_APERTURE_ALIGN_Y
Aperture Align Y =   1.2 %
AP_APERTURE_ALIGN_X
Aperture Align X =  11.5 %
AP_STAGE_GOTO_M
Stage goto M =  0.000 mm
AP_CURSOR_HEIGHT
Cursor Height = 0.00 nm
AP_CURSOR_WIDTH
Cursor Width = 13.39 nm
AP_PPA_5
Pa 6 = 0.00 nm
AP_PPA_4
Pa 5 = 0.00 nm
AP_PROFILE_W2
Profile Width 2 = 0.00 nm
AP_PROFILE_W1
Profile Width 1 = 0.00 nm
AP_H_5
H 6 = 0.00 nm
AP_H_4
H 5 = 0.00 nm
AP_H_3
H 4 = 0.00 nm
AP_H_2
H 3 = 0.00 nm
AP_H_1
H 2 = 0.00 nm
AP_H_0
H 1 = 0.00 nm
AP_PPB_6
Pb 7 =   0.0 °
AP_PPB_5
Pb 6 =   0.0 °
AP_PPB_4
Pb 5 =   0.0 °
AP_PPA_9
Pa 10 = 0.00 nm
AP_PPA_8
Pa 9 = 0.00 nm
AP_PPA_7
Pa 8 = 0.00 nm
AP_PPA_6
Pa 7 = 0.00 nm
AP_FCF_SETTING
FCF Setting =   0.0 %
AP_V_9
V 10 = 0.00 nm
AP_V_8
V 9 = 0.00 nm
AP_V_7
V 8 = 0.00 nm
AP_V_6
V 7 = 0.00 nm
AP_V_5
V 6 = 0.00 nm
AP_V_4
V 5 = 0.00 nm
AP_V_3
V 4 = 0.00 nm
AP_V_2
V 3 = 0.00 nm
AP_V_1
V 2 = 0.00 nm
AP_V_0
V 1 = 0.00 nm
AP_H_9
H 10 = 0.00 nm
AP_H_8
H 9 = 0.00 nm
AP_H_7
H 8 = 0.00 nm
AP_H_6
H 7 = 0.00 nm
AP_STAGE_DELTA_M
Stage Delta M =  0.000 mm
AP_STAGE_DELTA_R
Stage Delta R =   0.0 °
AP_STAGE_DELTA_T
Stage Delta T =   0.0 °
AP_STAGE_DELTA_Z
Stage Delta Z =  0.000 mm
AP_STAGE_DELTA_Y
Stage Delta Y =  0.000 mm
AP_STAGE_DELTA_X
Stage Delta X =  0.000 mm
AP_SPACER_THICKNESS
Spacer Thickness =  0.000 mm
AP_SAMPLE_HEIGHT
Compu. Height =  0.000 mm
AP_IMAGE_PIXEL_SIZE
Image Pixel Size = 1.5 nm
AP_RADIAL_AREA_1
Db 2 =     0. nm²
AP_RADIAL_AREA_0
Db 1 =     0. nm²
AP_USER_MAX_EHT
User Max EHT = 30.00 kV
AP_PROF2_X2
Profile 2 X2 = 0     
AP_PROF2_X1
Profile 2 X1 = 0     
AP_PROF1_X2
Profile 1 X2 = 0     
AP_PROF1_X1
Profile 1 X1 = 0     
AP_CCD_ILLUMINATION
CCD Illum. = 100.0 %
AP_RADIAL_AREA_3
Db 4 =     0. nm²
AP_RADIAL_AREA_2
Db 3 =     0. nm²
AP_PRINT_NUMBER
Print No. = 0       
AP_FILE_NUMBER
File No = 13195   
AP_SPECIMEN_HEIGHT
Specimen Height =    0 mm
AP_ESD_EXCITATION
ESD Excitation =   0.0 %
AP_STAGE_LOW_R
Stage low R = -380.0 °
AP_STAGE_HIGH_R
Stage high R = 380.0 °
AP_FRAME_COUNTER
Frame Counter = 898957
AP_SEM_LEVEL_AT_TILT
SEM Level @ =   0.0 °
AP_DC_MAX_ATTEMPTS
Drift Max Tries = 10
AP_DC_MIN_CONF
Drift Min Conf =  50.0 %
AP_DC_MAX_PIX_ERROR
Drift Max.Pix.Error = 1     
AP_ESB_GRID
ESB Grid =   100 V
AP_VAC_READY_AT
Vac Ready @ = 2.00e-005 mbar
AP_DEFECT_ID
Defect ID = 0       
AP_HOLDER_HEIGHT
Holder Height = 16.200 mm
AP_HOLDER_LENGTH
Holder Length = 20.000 mm
AP_HOLDER_WIDTH
Holder Width = 20.000 mm
AP_HOLDER_DIAMETER
Holder Diameter = 50.000 mm
AP_SI_FACTOR
SmartImage Sharpening =   0.0 %
AP_SI_THRESHOLD
SmartImage Threshold =   0.0 %
AP_SI_ENHANCEMENT
SmartImage Contrast =   0.0 %
AP_LASER_FINDER_ILLUM
Laser Illumination =   0.0 %
AP_ESB_GRID_IS
ESB Grid is =     0 V
AP_SI_TOPOGRAPHY
SmartImage Topography =   0.0 %
AP_SPECIMEN_DIAMETER
Specimen Diameter =   10 mm
AP_STAGE_AT_Z
Stage at Z = 17.077 mm
AP_STAGE_AT_Y
Stage at Y = 19.555 mm
AP_STAGE_AT_X
Stage at X = 29.451 mm
AP_SAMPLE_AT_Y
Sample at Y = 0.0000
AP_SAMPLE_AT_X
Sample at X = 0.0000
AP_STAGE_AT_T
Stage at T =   0.0 °
AP_STAGE_AT_R
Stage at R = 264.4 °
AP_ACTUALCURRENT
Fil I =  2.390 A
AP_ACTUALKV
EHT =  4.00 kV
AP_STAGE_AT_M
Stage at M =  0.000 mm
AP_DATE
Date :15 Dec 2009
AP_TIME
Time :17:52:23
SV_SAMPLE_ID
Sample ID = 
SV_IMAGE_PATH
Images = C:\Program Files\Carl Zeiss SMT Ltd\SmartSEM\Images\cma\15dic09-sth sth\
SV_VERSION
Version = V05.03.05 : 09-Sep-08
SV_SERIAL_NUMBER
Serial No. = SUPRA 40-11-67
SV_USER_TEXT
User Text = 
SV_OPERATOR
Operator = 
SV_USER_NAME
User Name = SYSTEM
SV_FILE_NAME
File Name = cm4989.tif

Code: Select all

identify -verbose Q32_cm4989_zip.tif
Image: Q32_cm4989_zip.tif
  Format: TIFF (Tagged Image File Format)
  Class: PseudoClass
  Geometry: 1024x768+0+0
  Resolution: 1x1
  Print size: 1024x768
  Units: Undefined
  Type: Palette
  Base type: Palette
  Endianess: MSB
  Colorspace: sRGB
  Depth: 16-bit
  Channel depth:
    red: 16-bit
    green: 16-bit
    blue: 16-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
    Green:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
    Blue:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65280 (0.996109)
      mean: 19926.9 (0.304065)
      standard deviation: 15518.9 (0.236804)
      kurtosis: 1.95397
      skewness: 1.67004
  Colors: 250
  Histogram:
(snipped)
  Colormap: 256
(snipped)
  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)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 1024x768+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: TopLeft
  Properties:
    date:create: 2012-10-03T21:14:55-03:00
    date:modify: 2012-10-03T21:14:55-03:00
    signature: 0dae07722bd09fafb3f2605d56c1b76e616e1a4e2469bfda0519d95e9735b03e
    tiff:document: Q32_cm4989_zip.tif
    tiff:endian: lsb
    tiff:photometric: palette
    tiff:rows-per-strip: 768
  Artifacts:
    filename: Q32_cm4989_zip.tif
    verbose: true
  Tainted: False
  Filesize: 623KB
  Number pixels: 786K
  Pixels per second: 39.32MB
  User time: 0.020u
  Elapsed time: 0:01.019
  Version: ImageMagick 6.7.7-10 2012-08-27 Q16 http://www.imagemagick.org

Code: Select all

tiffinfo Q32_cm4989_zip.tif
TIFF Directory at offset 0x9784c (620620)
  Image Width: 1024 Image Length: 768
  Resolution: 1, 1 (unitless)
  Bits/Sample: 8
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: palette color (RGB from colormap)
  FillOrder: msb-to-lsb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 1
  Rows/Strip: 768
  Planar Configuration: single image plane
  Page Number: 0-1
  Color Map: (present)
  DocumentName: Q32_cm4989_zip.tif
  White Point: 0.3127-0.329
  PrimaryChromaticities: 0.640000,0.330000,0.300000,0.600000,0.150000,0.060000
I tried using -debug All but I couldn't see anything obvious, except maybe this part:

Code: Select all

2012-10-03T21:30:42-03:00 0:00.010 0.000u 6.7.7 Configure convert.im6[8605]: loc
ale.c/LoadLocaleList/1092/Configure
  Loading locale configure file "/usr/share/ImageMagick-6.7.7/english.xml" ...
2012-10-03T21:30:42-03:00 0:00.010 0.000u 6.7.7 Exception convert.im6[8605]: tif
f.c/TIFFWarnings/768/Exception
  Q32_cm4989.tif: unknown field with tag 34118 (0x8546) encountered. `TIFFReadDi
rectory'
2012-10-03T21:30:42-03:00 0:00.010 0.000u 6.7.7 Coder convert.im6[8605]: tiff.c/ReadTIFFImage/986/Coder
  Geometry: 1024x768

Thanks for your help!

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2012-10-03T18:27:16-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.7.9-10 Beta available by sometime tomorrow. Thanks.

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2012-10-03T20:50:42-07:00
by arnoques
Many thanks!! That was certainly fast :D

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T07:32:03-07:00
by Bingo
Sorry to up this old thread, but I have the same problem and cannot find aversion of ImageMagick that would preserve unkown tags.

The relevant tiffinfo is :

Code: Select all

TIFFReadDirectory: Warning, 17_000737870_005092700_17.tif: unknown field with tag 33550 (0x830e) encountered.
TIFFReadDirectory: Warning, 17_000737870_005092700_17.tif: unknown field with tag 33922 (0x8482) encountered.
TIFFReadDirectory: Warning, 17_000737870_005092700_17.tif: unknown field with tag 34735 (0x87af) encountered.
TIFFReadDirectory: Warning, 17_000737870_005092700_17.tif: unknown field with tag 34737 (0x87b1) encountered.
TIFFReadDirectory: Warning, 17_000737870_005092700_17.tif: unknown field with tag 42113 (0xa481) encountered.
TIFF Directory at offset 0x8 (8)
  Image Width: 8000 Image Length: 8000
  Tile Width: 256 Tile Length: 256
  Resolution: 1, 1 (unitless)
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: RGB color
  Extra Samples: 1<unassoc-alpha>
  Samples/Pixel: 4
  Planar Configuration: single image plane
  Tag 33550: 0.158750,0.158750,0.000000
  Tag 33922: 0.000000,0.000000,0.000000,737870.000000,5092700.000000,0.000000
  Tag 34735: 1,1,0,7,1024,0,1,1,1025,0,1,1,1026,34737,22,0,2049,34737,7,22,2054,0,1,9102,3072,0,1,32631,3076,0,1,9001
  Tag 34737: WGS 84 / UTM zone 31N|WGS 84|
  Tag 42113: 0
  Predictor: horizontal differencing 2 (0x2)
and after running

Code: Select all

convert 17_000737870_005092700_17.tif -compress zip 17.tif
The tags are removed :

Code: Select all

TIFF Directory at offset 0x43483c (4409404)
  Image Width: 8000 Image Length: 8000
  Resolution: 1, 1 (unitless)
  Bits/Sample: 8
  Compression Scheme: AdobeDeflate
  Photometric Interpretation: RGB color
  Extra Samples: 1<unassoc-alpha>
  FillOrder: msb-to-lsb
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 4
  Rows/Strip: 8000
  Planar Configuration: single image plane
  Page Number: 0-1
  DocumentName: 17.tif
  White Point: 0.3127-0.329
  PrimaryChromaticities: 0.640000,0.330000,0.300000,0.600000,0.150000,0.060000
  Predictor: horizontal differencing 2 (0x2)

I have tried with 6.7.9-10 and 6.8.0-10 (since magick reported that the bug was fixed in 6.7.9-10 beta).
I have also tried with the latest 6.x version (6.9.10-13 as of now).
All versions show the same behavior and strip unknown tags.

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T09:37:25-07:00
by fmw42
The works fine for me on IM 6.9.10.13 Q16 Mac OSX

Code: Select all

convert Q32_cm4989.tif -compress zip tmp2.tif

Code: Select all

identify -verbose tmp2.tif
Image: tmp2.tif
...
Compression: Zip
...
 Profiles:
    Profile-tiff:34118: 10702 bytes

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T11:33:59-07:00
by Bingo
But isn't this a known tag ? identify shows the tag name.
The problem is with custom tags ("unknown field with tag" warning during conversion, "Tag 33550" in identify).

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T13:26:13-07:00
by fmw42
Warnings like that are just warning that IM does not understand custom TAGs. I do not think that they get removed. At least in my case it did not happen. If you do not want to see the warnings, add -quiet to your command line right after convert/magick depending upon your version.

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T13:55:38-07:00
by Bingo
Yes I know about quiet, but warnings are not the problem here.
The tags are removed in my case, as shown by the identify I posted for the input and output tiffs.

You mean that you have the warnings about unkown tags and still have them in the output ?

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-24T14:25:22-07:00
by fmw42
Yes. Perhaps your version of ImageMagick is prior to any bug fix for that issue mentioned above. I suggest you upgrade your ImageMagick and perhaps libtiff. What tag is in your input that is not in your output? Post an example TIFF image that shows this problem to you, so we can test with it.

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-26T02:49:01-07:00
by Bingo
As I mentioned in my post, I tried with different versions, including the latest 7.x and latest 6.x.
I uploaded a sample file here https://ufile.io/y40ao
As you can see this is a GeoTIFF, so the missing tags in the output are 34264 (ModelTransformationTag), 34735 (GeoKeyDirectoryTag) and 42113 (GDAL_NODATA).

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-26T07:21:14-07:00
by magick
ImageMagick does not support proprietary TIFF tags.

Re: TIFF to TIFF convert doesn't keep custom tag

Posted: 2018-10-27T01:34:56-07:00
by Bingo
All right, the post about a patch being on its way had me thinking otherwise.
Thanks for the information though.