Skip to content
This repository was archived by the owner on Dec 8, 2017. It is now read-only.

Commit

Permalink
changed: Split general metadata code (TImgData) off of unit dExif and…
Browse files Browse the repository at this point in the history
… export to new unit dMetadata.

fixed: all demo programs ("uses dmetadata")
  • Loading branch information
wp-xyz committed Sep 10, 2017
1 parent 338d5c4 commit 5d8d855
Show file tree
Hide file tree
Showing 14 changed files with 133 additions and 1,360 deletions.
1,402 changes: 60 additions & 1,342 deletions dEXIF.pas

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions dIPTC.pas
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,12 @@ procedure InitITag(out ATag: ITag);
implementation

uses
dUtils, dEXIF;
(*
var
Buffer: ansistring;
*)
dUtils, dMetadata, dEXIF;

//------------------------------------------------------------------------------
// TIPTCData
//------------------------------------------------------------------------------

constructor TIPTCdata.Create(AParent: TObject);
begin
inherited Create;
Expand Down
6 changes: 5 additions & 1 deletion dexif_package.lpk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(LCLWidgetType)"/>
</SearchPaths>
</CompilerOptions>
<Files Count="8">
<Files Count="9">
<Item1>
<Filename Value="dEXIF.pas"/>
<UnitName Value="dEXIF"/>
Expand Down Expand Up @@ -41,6 +41,10 @@
<Filename Value="dExif.inc"/>
<Type Value="Include"/>
</Item8>
<Item9>
<Filename Value="dmetadata.pas"/>
<UnitName Value="dmetadata"/>
</Item9>
</Files>
<RequiredPkgs Count="2">
<Item1>
Expand Down
3 changes: 2 additions & 1 deletion dexif_package.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

unit dexif_package;

{$warn 5023 off : no warning about unused units}
interface

uses
dEXIF, dIPTC, msData, dexifwrite, dGlobal, dTags, dUtils;
dEXIF, dIPTC, msData, dexifwrite, dGlobal, dTags, dUtils, dMetadata;

implementation

Expand Down
2 changes: 1 addition & 1 deletion dexifwrite.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface

uses
Classes, SysUtils,
dGlobal, dUtils, dEXIF;
dGlobal, dUtils, dMetadata, dEXIF;

type
TExifWriter = class(TBasicMetadataWriter)
Expand Down
47 changes: 47 additions & 0 deletions dglobal.pas
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,53 @@ TExifRational = record

TGpsFormat = (gf_DD, gf_DM, gf_DMS, gf_DD_Short, gf_DM_Short, gf_DMS_Short);

TSection = record
Data: ansistring;
DType: integer;
Size: longint;
Base: longint;
end;
PSection = ^TSection;

const
dExifVersion = '1.04';

//--------------------------------------------------------------------------
// JPEG markers consist of one or more= $FF bytes, followed by a marker
// code byte (which is not an FF). Here are the marker codes of interest
// in this program.
//--------------------------------------------------------------------------
M_SOF0 = $C0; // Start Of Frame N
M_SOF1 = $C1; // N indicates which compression process
M_SOF2 = $C2; // Only SOF0-SOF2 are now in common use
M_SOF3 = $C3;
M_DHT = $C4; // Define Huffman Table
M_SOF5 = $C5; // NB: codes C4 and CC are NOT SOF markers
M_SOF6 = $C6;
M_SOF7 = $C7;
M_SOF9 = $C9;
M_SOF10 = $CA;
M_SOF11 = $CB;
M_DAC = $CC; // Define arithmetic coding conditioning
M_SOF13 = $CD;
M_SOF14 = $CE;
M_SOF15 = $CF;
M_SOI = $D8; // Start Of Image (beginning of datastream)
M_EOI = $D9; // End Of Image (end of datastream)
M_SOS = $DA; // Start Of Scan (begins compressed data)
M_DQT = $DB; // Define Quantization table
M_DNL = $DC; // Define number of lines
M_DRI = $DD; // Restart interoperability definition
M_DHP = $DE; // Define hierarchical progression
M_EXP = $DF; // Expand reference component
M_JFIF = $E0; // Jfif marker 224
M_EXIF = $E1; // Exif marker 225
M_EXIFEXT = $E2; // Exif extended marker 225
// M_KODAK = $E3; // Kodak marker ???
M_IPTC = $ED; // IPTC - Photoshop 237
M_APP14 = $EE; // Photoshop data: App14
M_COM = $FE; // Comment 254

// Format of data in an IFD record
FMT_BYTE = 1;
FMT_STRING = 2;
Expand Down Expand Up @@ -138,6 +183,8 @@ TExifRational = record

DEFAULT_THUMBNAIL_SIZE = 200;

NO_ERROR = '<none>';

{$IFDEF FPC}
crlf = LineEnding;
{$ELSE}
Expand Down
2 changes: 1 addition & 1 deletion samples/00_Basic/ureadexif.pas
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TForm1 = class(TForm)
implementation

uses
dGlobal, dEXIF;
dGlobal, dMetadata;

{$R *.lfm}

Expand Down
2 changes: 1 addition & 1 deletion samples/01_CreateImage/ucreateexif.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Form1: TForm1
Caption = 'Form1'
ClientHeight = 417
ClientWidth = 545
Visible = False
LCLVersion = '1.9.0.0'
object BuCreateImage: TButton
Left = 8
Height = 25
Expand Down
2 changes: 1 addition & 1 deletion samples/01_CreateImage/ucreateexif.pas
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface

uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
dExif;
dMetadata, dExif;

type

Expand Down
3 changes: 2 additions & 1 deletion samples/91_SimpleTest/Lazarus/ReadWriteTest.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
<IsPartOfProject Value="True"/>
</Unit4>
<Unit5>
<Filename Value="..\..\..\dGlobal.pas"/>
<Filename Value="..\..\..\dglobal.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="dGlobal"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\dUtils.pas"/>
Expand Down
4 changes: 2 additions & 2 deletions samples/91_SimpleTest/common/rwMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface
{$ENDIF}
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,
StdCtrls, Buttons, ComCtrls, ExtCtrls, Variants,
dGlobal, dExif, ImgList;
dGlobal, dMetadata, ImgList;

type

Expand Down Expand Up @@ -74,7 +74,7 @@ implementation

uses
StrUtils, Math, IniFiles,
dUtils;
dUtils, dExif;

const
IMGINDEX_SUCCESS = 0;
Expand Down
2 changes: 1 addition & 1 deletion samples/92_MultiReadTest/common/mrtmain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface
{$ENDIF}
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
ComCtrls, ExtCtrls, ImgList,
dExif;
dMetaData;

type

Expand Down
4 changes: 2 additions & 2 deletions samples/99_OrigDemo/common/MainView.pas
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface
{$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtDlgs, StdCtrls, ComCtrls, ExtCtrls,
dGlobal, dExif, dIPTC, msData;
dGlobal, dMetadata, dExif, dIPTC, msData;

type

Expand Down Expand Up @@ -83,7 +83,7 @@ TForm1 = class(TForm)

var
Form1: TForm1;
ImgData:TImgData;
ImgData: TImgData;

implementation

Expand Down
3 changes: 2 additions & 1 deletion samples/99_OrigDemo/common/ViewIPTC.pas
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ interface
Windows, Messages,
{$ENDIF}
SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, ExtDlgs, ComCtrls, dEXIF, dIPTC, About;
ExtCtrls, StdCtrls, ExtDlgs, ComCtrls,
dMetadata, dEXIF, dIPTC, About;

const
ProgName = 'IPTCView';
Expand Down

0 comments on commit 5d8d855

Please sign in to comment.