File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -410,7 +410,18 @@ IEnumerable<Directory> ProcessTextChunk(string keyword, byte[] textBytes)
410
410
{
411
411
if ( TryProcessRawProfile ( out int byteCount ) )
412
412
{
413
- yield return new IptcReader ( ) . Extract ( new SequentialByteArrayReader ( textBytes ) , byteCount ) ;
413
+ // From ExifTool:
414
+ // this is unfortunate, but the "IPTC" profile may be stored as either
415
+ // IPTC IIM or a Photoshop IRB resource, so we must test for this.
416
+ // Check if the first byte matches IptcReader.IptcMarkerByte (0x1c)
417
+ if ( byteCount > 0 && textBytes [ 0 ] == 0x1c )
418
+ yield return new IptcReader ( ) . Extract ( new SequentialByteArrayReader ( textBytes ) , byteCount ) ;
419
+ else
420
+ {
421
+ foreach ( var psDirectory in new Photoshop . PhotoshopReader ( ) . Extract ( new SequentialByteArrayReader ( textBytes ) , byteCount ) )
422
+ yield return psDirectory ;
423
+
424
+ }
414
425
}
415
426
else
416
427
{
You can’t perform that action at this time.
0 commit comments