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