You've already forked lazarus-ccr
fpexif: Less hints and warnings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8125 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9,7 +9,7 @@ object MainForm: TMainForm
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.3.0.0'
|
||||||
object ShellPanel: TPanel
|
object ShellPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 691
|
Height = 691
|
||||||
@ -97,7 +97,6 @@ object MainForm: TMainForm
|
|||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
Caption = 'Thumbnail image'
|
Caption = 'Thumbnail image'
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -135,7 +134,6 @@ object MainForm: TMainForm
|
|||||||
Top = 4
|
Top = 4
|
||||||
Width = 24
|
Width = 24
|
||||||
Caption = 'File: '
|
Caption = 'File: '
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
@ -206,7 +204,7 @@ object MainForm: TMainForm
|
|||||||
Height = 19
|
Height = 19
|
||||||
Hint = 'Try to decode information in the MakerNote tag if possible'
|
Hint = 'Try to decode information in the MakerNote tag if possible'
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 127
|
Width = 125
|
||||||
Caption = 'Decode MakerNotes'
|
Caption = 'Decode MakerNotes'
|
||||||
Checked = True
|
Checked = True
|
||||||
State = cbChecked
|
State = cbChecked
|
||||||
@ -217,11 +215,11 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = CbDecodeMakerNotes
|
AnchorSideTop.Control = CbDecodeMakerNotes
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 135
|
Left = 133
|
||||||
Height = 19
|
Height = 19
|
||||||
Hint = 'Show the numerical ID of every tag'
|
Hint = 'Show the numerical ID of every tag'
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 88
|
Width = 86
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'Show tag IDs'
|
Caption = 'Show tag IDs'
|
||||||
Checked = True
|
Checked = True
|
||||||
@ -234,11 +232,11 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = CbDecodeMakerNotes
|
AnchorSideTop.Control = CbDecodeMakerNotes
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 231
|
Left = 227
|
||||||
Height = 19
|
Height = 19
|
||||||
Hint = 'Show the ID of the parent tag.'#13#10'List will be updated when the next file is loaded.'
|
Hint = 'Show the ID of the parent tag.'#13#10'List will be updated when the next file is loaded.'
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 94
|
Width = 92
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'with parent ID'
|
Caption = 'with parent ID'
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
@ -247,11 +245,11 @@ object MainForm: TMainForm
|
|||||||
end
|
end
|
||||||
object PgImage: TTabSheet
|
object PgImage: TTabSheet
|
||||||
Caption = 'Image'
|
Caption = 'Image'
|
||||||
ClientHeight = 545
|
ClientHeight = 511
|
||||||
ClientWidth = 639
|
ClientWidth = 639
|
||||||
object Image: TImage
|
object Image: TImage
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 545
|
Height = 511
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 639
|
Width = 639
|
||||||
Align = alClient
|
Align = alClient
|
||||||
@ -302,7 +300,6 @@ object MainForm: TMainForm
|
|||||||
Width = 135
|
Width = 135
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
Caption = 'Change EXIF date/time to'
|
Caption = 'Change EXIF date/time to'
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
object EdChangeDate: TEdit
|
object EdChangeDate: TEdit
|
||||||
AnchorSideLeft.Control = LblChangeDate
|
AnchorSideLeft.Control = LblChangeDate
|
||||||
|
@ -7,7 +7,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ShellCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ShellCtrls,
|
||||||
ExtCtrls, ComCtrls, StdCtrls,
|
ExtCtrls, ComCtrls, StdCtrls,
|
||||||
fpeGlobal, fpeMetadata, fpeMakerNote;
|
fpeGlobal, fpeMetadata;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ type
|
|||||||
procedure ShellTreeViewGetImageIndex(Sender: TObject; Node: TTreeNode);
|
procedure ShellTreeViewGetImageIndex(Sender: TObject; Node: TTreeNode);
|
||||||
procedure ShellTreeViewSelectionChanged(Sender: TObject);
|
procedure ShellTreeViewSelectionChanged(Sender: TObject);
|
||||||
procedure TagListViewCompare(Sender: TObject; Item1, Item2: TListItem;
|
procedure TagListViewCompare(Sender: TObject; Item1, Item2: TListItem;
|
||||||
Data: Integer; var Compare: Integer);
|
{%H-}Data: Integer; var Compare: Integer);
|
||||||
procedure TagListViewSelectItem(Sender: TObject; Item: TListItem;
|
procedure TagListViewSelectItem(Sender: TObject; Item: TListItem;
|
||||||
Selected: Boolean);
|
Selected: Boolean);
|
||||||
private
|
private
|
||||||
@ -78,7 +78,7 @@ implementation
|
|||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLType, LCLVersion, IniFiles, Math, StrUtils, DateUtils, IntfGraphics,
|
LCLType, LCLVersion, IniFiles, Math, DateUtils, IntfGraphics,
|
||||||
fpeTags, fpeExifData, fpeIptcData;
|
fpeTags, fpeExifData, fpeIptcData;
|
||||||
|
|
||||||
const
|
const
|
||||||
@ -534,7 +534,6 @@ const
|
|||||||
);
|
);
|
||||||
var
|
var
|
||||||
lTag: TTag;
|
lTag: TTag;
|
||||||
s: String;
|
|
||||||
tagID: TTagIDRec;
|
tagID: TTagIDRec;
|
||||||
begin
|
begin
|
||||||
if Selected then begin
|
if Selected then begin
|
||||||
@ -557,8 +556,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainForm.UpdateCaption;
|
procedure TMainForm.UpdateCaption;
|
||||||
var
|
|
||||||
fn: String;
|
|
||||||
begin
|
begin
|
||||||
if FImgInfo <> nil then
|
if FImgInfo <> nil then
|
||||||
FileNameInfo.Caption := Format(
|
FileNameInfo.Caption := Format(
|
||||||
|
@ -8,7 +8,7 @@ object MainForm: TMainForm
|
|||||||
ClientWidth = 788
|
ClientWidth = 788
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.3.0.0'
|
||||||
object BtnLoad: TButton
|
object BtnLoad: TButton
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
@ -114,7 +114,7 @@ object MainForm: TMainForm
|
|||||||
Left = 208
|
Left = 208
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 96
|
Width = 94
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'Decode values'
|
Caption = 'Decode values'
|
||||||
Checked = True
|
Checked = True
|
||||||
@ -127,10 +127,10 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = CbVerbosity
|
AnchorSideTop.Control = CbVerbosity
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 312
|
Left = 310
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 127
|
Width = 125
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'Truncate binary tags'
|
Caption = 'Truncate binary tags'
|
||||||
Checked = True
|
Checked = True
|
||||||
@ -143,10 +143,10 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = CbVerbosity
|
AnchorSideTop.Control = CbVerbosity
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 447
|
Left = 443
|
||||||
Height = 19
|
Height = 19
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 123
|
Width = 121
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
Caption = 'Binary tags as ASCII'
|
Caption = 'Binary tags as ASCII'
|
||||||
OnChange = CbBinaryAsASCIIChange
|
OnChange = CbBinaryAsASCIIChange
|
||||||
@ -211,7 +211,6 @@ object MainForm: TMainForm
|
|||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
Caption = 'New value'
|
Caption = 'New value'
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
object EdNewTagValue: TEdit
|
object EdNewTagValue: TEdit
|
||||||
AnchorSideLeft.Control = Thumbnail
|
AnchorSideLeft.Control = Thumbnail
|
||||||
@ -237,7 +236,6 @@ object MainForm: TMainForm
|
|||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
Caption = 'Tag'
|
Caption = 'Tag'
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
object OpenDialog: TOpenDialog
|
object OpenDialog: TOpenDialog
|
||||||
DefaultExt = '.jpg'
|
DefaultExt = '.jpg'
|
||||||
|
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
ExtCtrls, fpeMetadata, fpeMakerNote;
|
ExtCtrls, fpeMetadata;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -1470,7 +1470,7 @@ end;
|
|||||||
|
|
||||||
procedure TGPSPositionTag.SetAsFloat(const AValue: Double);
|
procedure TGPSPositionTag.SetAsFloat(const AValue: Double);
|
||||||
var
|
var
|
||||||
arr: TExifDoubleArray;
|
arr: TExifDoubleArray = nil;
|
||||||
begin
|
begin
|
||||||
SetLength(arr, 3);
|
SetLength(arr, 3);
|
||||||
SplitGps(AValue, arr[0], arr[1], arr[2]);
|
SplitGps(AValue, arr[0], arr[1], arr[2]);
|
||||||
@ -1709,8 +1709,8 @@ end;
|
|||||||
|
|
||||||
function TUserCommentTag.GetAsString: String;
|
function TUserCommentTag.GetAsString: String;
|
||||||
var
|
var
|
||||||
sw: WideString;
|
sw: WideString = '';
|
||||||
sa: AnsiString;
|
sa: AnsiString = '';
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
|
|
||||||
@ -1802,7 +1802,7 @@ end;
|
|||||||
|
|
||||||
function TXPTag.GetAsString: String;
|
function TXPTag.GetAsString: String;
|
||||||
var
|
var
|
||||||
ws: WideString;
|
ws: WideString = '';
|
||||||
begin
|
begin
|
||||||
SetLength(ws, Length(FRawData) div SizeOf(WideChar));
|
SetLength(ws, Length(FRawData) div SizeOf(WideChar));
|
||||||
Move(FRawData[0], ws[1], Length(FRawData));
|
Move(FRawData[0], ws[1], Length(FRawData));
|
||||||
|
@ -9,7 +9,7 @@ unit fpeExifReadWrite;
|
|||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
{$MODE Delphi}
|
{$MODE Delphi}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$WARN 6058 off : Call to subroutine "$1" marked as inline is not inlined}
|
||||||
{$INCLUDE fpexif.inc}
|
{$INCLUDE fpexif.inc}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
@ -337,6 +337,7 @@ begin
|
|||||||
block := TAdobeImageResourceBlock(FImageResourceBlocks[AIndex]);
|
block := TAdobeImageResourceBlock(FImageResourceBlocks[AIndex]);
|
||||||
AIdentifier := block.Identifier;
|
AIdentifier := block.Identifier;
|
||||||
AName := block.Name;
|
AName := block.Name;
|
||||||
|
AData := nil;
|
||||||
SetLength(AData, Length(block.Data));
|
SetLength(AData, Length(block.Data));
|
||||||
if Length(block.Data) > 0 then
|
if Length(block.Data) > 0 then
|
||||||
Move(block.Data[0], AData[0], Length(AData));
|
Move(block.Data[0], AData[0], Length(AData));
|
||||||
|
@ -120,7 +120,7 @@ var
|
|||||||
len: DWord;
|
len: DWord;
|
||||||
tagdef: TTagDef;
|
tagdef: TTagDef;
|
||||||
tagID: TTagID;
|
tagID: TTagID;
|
||||||
s: String;
|
s: String = '';
|
||||||
w: Word;
|
w: Word;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
sa: ansistring;
|
sa: ansistring;
|
||||||
@ -214,6 +214,7 @@ var
|
|||||||
begin
|
begin
|
||||||
FImgFormat := AImgFormat;
|
FImgFormat := AImgFormat;
|
||||||
|
|
||||||
|
lData := nil;
|
||||||
SetLength(lData, Length(IPTC_SIGNATURE)); // 'Photoshop 3.0'
|
SetLength(lData, Length(IPTC_SIGNATURE)); // 'Photoshop 3.0'
|
||||||
if AStream.Read(lData[0], Length(lData)) <> Length(lData) then begin
|
if AStream.Read(lData[0], Length(lData)) <> Length(lData) then begin
|
||||||
Error(rsIncorrectFileStructure);
|
Error(rsIncorrectFileStructure);
|
||||||
@ -245,7 +246,7 @@ procedure TIptcReader.ReadImageResourceBlock(AStream: TStream;
|
|||||||
out AID: Word; out AName: String; out AData: TBytes);
|
out AID: Word; out AName: String; out AData: TBytes);
|
||||||
var
|
var
|
||||||
len: Byte;
|
len: Byte;
|
||||||
s: Ansistring;
|
s: Ansistring = '';
|
||||||
lSize: DWord;
|
lSize: DWord;
|
||||||
begin
|
begin
|
||||||
AID := BEtoN(ReadWord(AStream));
|
AID := BEtoN(ReadWord(AStream));
|
||||||
@ -263,6 +264,7 @@ begin
|
|||||||
if lSize = 0 then
|
if lSize = 0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
AData := nil;
|
||||||
SetLength(AData, lSize);
|
SetLength(AData, lSize);
|
||||||
AStream.Read(AData[0], lSize);
|
AStream.Read(AData[0], lSize);
|
||||||
end;
|
end;
|
||||||
|
@ -122,7 +122,7 @@ function TCanonMakerNoteReader.AddTag(AStream: TStream;
|
|||||||
const AIFDRecord: TIFDRecord; const AData: TBytes; AParent: TTagID): Integer;
|
const AIFDRecord: TIFDRecord; const AData: TBytes; AParent: TTagID): Integer;
|
||||||
var
|
var
|
||||||
tagDef: TTagDef;
|
tagDef: TTagDef;
|
||||||
w: array of Word;
|
w: array of Word = nil;
|
||||||
n,i: Integer;
|
n,i: Integer;
|
||||||
t: TTagID;
|
t: TTagID;
|
||||||
begin
|
begin
|
||||||
|
@ -133,7 +133,7 @@ function TMinoltaMakerNoteReader.AddTag(AStream: TStream;
|
|||||||
const AIFDRecord: TIFDRecord; const AData: TBytes; AParent: TTagID): Integer;
|
const AIFDRecord: TIFDRecord; const AData: TBytes; AParent: TTagID): Integer;
|
||||||
var
|
var
|
||||||
tagDef: TTagDef;
|
tagDef: TTagDef;
|
||||||
v: array of DWord;
|
v: array of DWord = nil;
|
||||||
n, i: Integer;
|
n, i: Integer;
|
||||||
t: TTagID;
|
t: TTagID;
|
||||||
d: Integer;
|
d: Integer;
|
||||||
|
@ -339,8 +339,9 @@ end;
|
|||||||
|
|
||||||
procedure TNikonMakerNoteReader.GetTagDefs(AStream: TStream);
|
procedure TNikonMakerNoteReader.GetTagDefs(AStream: TStream);
|
||||||
var
|
var
|
||||||
b: TBytes; //array of byte;
|
b: TBytes = nil; //array of byte;
|
||||||
tmp, tmp2: String;
|
tmp: String = '';
|
||||||
|
tmp2: String;
|
||||||
p: Integer;
|
p: Integer;
|
||||||
streamPos: Int64;
|
streamPos: Int64;
|
||||||
begin
|
begin
|
||||||
@ -375,7 +376,7 @@ end;
|
|||||||
|
|
||||||
function TNikonMakerNoteReader.Prepare(AStream: TStream): Boolean;
|
function TNikonMakerNoteReader.Prepare(AStream: TStream): Boolean;
|
||||||
var
|
var
|
||||||
b: TBytes;
|
b: TBytes = nil;
|
||||||
UCMake: String;
|
UCMake: String;
|
||||||
dw: DWord;
|
dw: DWord;
|
||||||
begin
|
begin
|
||||||
|
@ -458,7 +458,7 @@ const
|
|||||||
SIGNATURE_V3I = 'OLYMPUS'#00'II'#03#00;
|
SIGNATURE_V3I = 'OLYMPUS'#00'II'#03#00;
|
||||||
SIGNATURE_V3M = 'OLYMPUS'#00'MM'#03#00;
|
SIGNATURE_V3M = 'OLYMPUS'#00'MM'#03#00;
|
||||||
var
|
var
|
||||||
hdr: TBytes; //array of byte;
|
hdr: TBytes = nil; //array of byte;
|
||||||
p: Int64;
|
p: Int64;
|
||||||
begin
|
begin
|
||||||
p := AStream.Position;
|
p := AStream.Position;
|
||||||
|
@ -142,7 +142,7 @@ type
|
|||||||
ThumbnailFormat: byte; // 10: JPEG, 11: 1 byte-per-pixel palettized, 12: 3 byte-per-pixel RGB
|
ThumbnailFormat: byte; // 10: JPEG, 11: 1 byte-per-pixel palettized, 12: 3 byte-per-pixel RGB
|
||||||
end;
|
end;
|
||||||
// ThumbnailData are following
|
// ThumbnailData are following
|
||||||
PJpegJFXXSegment = ^TJpegJFXXSegment;
|
PJpegJFXXSegment = {%H-}^TJpegJFXXSegment;
|
||||||
|
|
||||||
TJpegSOF0Segment = packed record
|
TJpegSOF0Segment = packed record
|
||||||
DataPrecision: Byte;
|
DataPrecision: Byte;
|
||||||
@ -403,7 +403,7 @@ var
|
|||||||
n, count: Int64;
|
n, count: Int64;
|
||||||
savedPos: Int64;
|
savedPos: Int64;
|
||||||
{$IFDEF FPC}
|
{$IFDEF FPC}
|
||||||
s: RawByteString;
|
s: RawByteString = '';
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
s: String;
|
s: String;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -458,7 +458,7 @@ begin
|
|||||||
// Return to where the segment begins
|
// Return to where the segment begins
|
||||||
AInputStream.Position := savedPos - 2;
|
AInputStream.Position := savedPos - 2;
|
||||||
// Copy entire segment incl header
|
// Copy entire segment incl header
|
||||||
n := AOutputStream.CopyFrom(AInputStream, headerSize + 2);
|
n := AOutputStream.CopyFrom(AInputStream, Int64(headerSize) + 2);
|
||||||
if n <> Int64(headerSize) + 2 then
|
if n <> Int64(headerSize) + 2 then
|
||||||
Error(rsJpegReadWriteErrorInSegment);
|
Error(rsJpegReadWriteErrorInSegment);
|
||||||
end else
|
end else
|
||||||
@ -482,7 +482,7 @@ begin
|
|||||||
// Return to where the segment begins
|
// Return to where the segment begins
|
||||||
AInputStream.Position := AInputStream.Position - 4;
|
AInputStream.Position := AInputStream.Position - 4;
|
||||||
// Copy entire segment incl header
|
// Copy entire segment incl header
|
||||||
n := AOutputStream.CopyFrom(AInputStream, headerSize + 2);
|
n := AOutputStream.CopyFrom(AInputStream, Int64(headerSize) + 2);
|
||||||
if n <> Int64(headerSize) + 2 then
|
if n <> Int64(headerSize) + 2 then
|
||||||
Error(rsJpegReadWriteErrorInSegment);
|
Error(rsJpegReadWriteErrorInSegment);
|
||||||
end;
|
end;
|
||||||
@ -499,10 +499,10 @@ var
|
|||||||
size: Word;
|
size: Word;
|
||||||
streamsize: Int64;
|
streamsize: Int64;
|
||||||
p: Int64;
|
p: Int64;
|
||||||
buf: TBytes;
|
|
||||||
reader: TBasicMetadataReader;
|
reader: TBasicMetadataReader;
|
||||||
bigEndian: Boolean;
|
bigEndian: Boolean;
|
||||||
hdr: TBytes;
|
buf: TBytes = nil;
|
||||||
|
hdr: TBytes = nil;
|
||||||
hasJFIF: Boolean;
|
hasJFIF: Boolean;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
sa: ansistring;
|
sa: ansistring;
|
||||||
|
@ -865,6 +865,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
intval := GetAsIntegerArray;
|
intval := GetAsIntegerArray;
|
||||||
|
Result := nil;
|
||||||
SetLength(Result, Length(intVal));
|
SetLength(Result, Length(intVal));
|
||||||
for i:=0 to High(intval) do
|
for i:=0 to High(intval) do
|
||||||
Result[i] := intval[i] * 1.0;
|
Result[i] := intval[i] * 1.0;
|
||||||
@ -880,6 +881,7 @@ function TIntegerTag.GetAsIntegerArray: TExifIntegerArray;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
SetLength(Result, FCount);
|
SetLength(Result, FCount);
|
||||||
for i:=0 to FCount-1 do
|
for i:=0 to FCount-1 do
|
||||||
if not GetInteger(i, Result[i]) then begin
|
if not GetInteger(i, Result[i]) then begin
|
||||||
@ -906,6 +908,7 @@ var
|
|||||||
intval: TExifIntegerArray;
|
intval: TExifIntegerArray;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
intval := GetAsIntegerArray;
|
intval := GetAsIntegerArray;
|
||||||
SetLength(Result, Length(intval));
|
SetLength(Result, Length(intval));
|
||||||
for i:=0 to High(intval) do begin
|
for i:=0 to High(intval) do begin
|
||||||
@ -919,8 +922,8 @@ var
|
|||||||
intVal: Integer;
|
intVal: Integer;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
s: String;
|
s: String;
|
||||||
fmtStr: TStringArray;
|
fmtStr: TStringArray = nil;
|
||||||
lkup: TStringArray;
|
lkup: TStringArray = nil;
|
||||||
len: Integer;
|
len: Integer;
|
||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
@ -1041,7 +1044,7 @@ procedure TIntegerTag.SetAsString(const AValue: String);
|
|||||||
var
|
var
|
||||||
i, j, n: Integer;
|
i, j, n: Integer;
|
||||||
s: String;
|
s: String;
|
||||||
intArr: TExifIntegerArray;
|
intArr: TExifIntegerArray = nil;
|
||||||
begin
|
begin
|
||||||
if AValue = '' then begin
|
if AValue = '' then begin
|
||||||
SetLength(FRawData, 0);
|
SetLength(FRawData, 0);
|
||||||
@ -1161,6 +1164,7 @@ function TFloatTag.GetAsFloatArray: TExifDoubleArray;
|
|||||||
var
|
var
|
||||||
i, n: Integer;
|
i, n: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
n := Length(FRawData) div TagElementSize[ord(FType)];
|
n := Length(FRawData) div TagElementSize[ord(FType)];
|
||||||
SetLength(Result, n);
|
SetLength(Result, n);
|
||||||
for i := 0 to n-1 do
|
for i := 0 to n-1 do
|
||||||
@ -1186,6 +1190,7 @@ var
|
|||||||
f: TExifDoubleArray;
|
f: TExifDoubleArray;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
f := GetAsFloatArray;
|
f := GetAsFloatArray;
|
||||||
for i:=0 to High(f) do
|
for i:=0 to High(f) do
|
||||||
if IsNaN(f[i]) or (frac(f[i]) <> 0) then
|
if IsNaN(f[i]) or (frac(f[i]) <> 0) then
|
||||||
@ -1206,6 +1211,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := nil;
|
||||||
n := Length(FRawData) div TagElementSize[ord(FType)];
|
n := Length(FRawData) div TagElementSize[ord(FType)];
|
||||||
SetLength(Result, n);
|
SetLength(Result, n);
|
||||||
for i:=0 to n-1 do
|
for i:=0 to n-1 do
|
||||||
@ -1221,7 +1227,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
s: String;
|
s: String;
|
||||||
fval: Double;
|
fval: Double;
|
||||||
fmtStr: TStringArray;
|
fmtStr: TStringArray = nil;
|
||||||
begin
|
begin
|
||||||
{ Extract format string for each value. A simple format string is applied to
|
{ Extract format string for each value. A simple format string is applied to
|
||||||
all values. Inidividual format strings can be separated by '|'. }
|
all values. Inidividual format strings can be separated by '|'. }
|
||||||
@ -1432,7 +1438,7 @@ procedure TFloatTag.SetAsString(const AValue: String);
|
|||||||
var
|
var
|
||||||
i, j, n: Integer;
|
i, j, n: Integer;
|
||||||
s: String;
|
s: String;
|
||||||
floatArr: TExifDoubleArray;
|
floatArr: TExifDoubleArray = nil;
|
||||||
begin
|
begin
|
||||||
if AValue = '' then begin
|
if AValue = '' then begin
|
||||||
SetLength(FRawData, 0);
|
SetLength(FRawData, 0);
|
||||||
@ -1492,7 +1498,7 @@ end;
|
|||||||
|
|
||||||
function TStringTag.GetAsString: String;
|
function TStringTag.GetAsString: String;
|
||||||
var
|
var
|
||||||
sa: ansistring;
|
sa: ansistring = '';
|
||||||
begin
|
begin
|
||||||
// FIXME: The next lines assume that FValue stores a string as ansistring
|
// FIXME: The next lines assume that FValue stores a string as ansistring
|
||||||
// which is true only for Exif, probably not for IPTC and XMP.
|
// which is true only for Exif, probably not for IPTC and XMP.
|
||||||
|
@ -296,6 +296,7 @@ begin
|
|||||||
{$IFDEF ENDIAN_BIG}
|
{$IFDEF ENDIAN_BIG}
|
||||||
Result := AValue;
|
Result := AValue;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
|
Result := '';
|
||||||
SetLength(Result, Length(AValue));
|
SetLength(Result, Length(AValue));
|
||||||
for i:=1 to Length(AValue) do
|
for i:=1 to Length(AValue) do
|
||||||
Result[i] := WideChar(BEToN(PDWord(@AValue[i])^));
|
Result[i] := WideChar(BEToN(PDWord(@AValue[i])^));
|
||||||
@ -309,6 +310,7 @@ var
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFDEF ENDIAN_BIG}
|
{$IFDEF ENDIAN_BIG}
|
||||||
|
Result := '';
|
||||||
SetLength(Result, Length(AValue));
|
SetLength(Result, Length(AValue));
|
||||||
for i:=1 to Length(AValue) do
|
for i:=1 to Length(AValue) do
|
||||||
Result[i] := WideChar(LEToN(PDWord(@AValue[i])^));
|
Result[i] := WideChar(LEToN(PDWord(@AValue[i])^));
|
||||||
@ -324,6 +326,7 @@ begin
|
|||||||
{$IFDEF ENDIAN_BIG}
|
{$IFDEF ENDIAN_BIG}
|
||||||
Result := AValue;
|
Result := AValue;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
|
Result := '';
|
||||||
SetLength(Result, Length(AValue));
|
SetLength(Result, Length(AValue));
|
||||||
for i:=1 to Length(AValue) do
|
for i:=1 to Length(AValue) do
|
||||||
Result[i] := WideChar(NtoBE(PDWord(@AValue[i])^));
|
Result[i] := WideChar(NtoBE(PDWord(@AValue[i])^));
|
||||||
@ -337,6 +340,7 @@ var
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
{$IFDEF ENDIAN_BIG}
|
{$IFDEF ENDIAN_BIG}
|
||||||
|
Result := '';
|
||||||
SetLength(Result, Length(AValue));
|
SetLength(Result, Length(AValue));
|
||||||
for i:=1 to Length(AValue) do
|
for i:=1 to Length(AValue) do
|
||||||
Result[i] := WideChar(NtoLE(PDWord(@AValue[i])^));
|
Result[i] := WideChar(NtoLE(PDWord(@AValue[i])^));
|
||||||
@ -494,7 +498,7 @@ var
|
|||||||
mins, secs: Double;
|
mins, secs: Double;
|
||||||
i, j, len: Integer;
|
i, j, len: Integer;
|
||||||
n: Integer;
|
n: Integer;
|
||||||
s: String;
|
s: String = '';
|
||||||
res: Integer;
|
res: Integer;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
Result := false;
|
||||||
@ -1131,10 +1135,9 @@ var
|
|||||||
begin
|
begin
|
||||||
Assert(ASeparator <> '');
|
Assert(ASeparator <> '');
|
||||||
|
|
||||||
if AText = '' then begin
|
Result := nil;
|
||||||
SetLength(Result, 0);
|
if AText = '' then
|
||||||
exit;
|
exit;
|
||||||
end;
|
|
||||||
|
|
||||||
// AText := AText + ASeparator;
|
// AText := AText + ASeparator;
|
||||||
len := Length(AText);
|
len := Length(AText);
|
||||||
|
Reference in New Issue
Block a user