
JPGComment version 0.1 beta

Tested with Delphi 3.0 standard but should run in 2,3,4,5

(C) 1999 by Luke Komsta luke@ariadna.pl

-----------

DESCRIPTION

The JPG files can contain a comments. It is very good thing, but not used by
many JPG authors. It can contain copyright info, description of photo or some
tags which made sorting of pictures much easier. JPGComment is simple
component allows you to read, delete and change comments in JPGs.

PROPERTIES

FileName : string;
         contains a JPG file name

Comment : string;
         contains an actual comment. It of course can contain CR-LF sequences,
         so you can store a memo lines by
         jpgcomment1.comment:=memo1.lines.text or etc.

METHODS

ReadComment;
         reads a comment from file which name is stored in FileName. After
         that, readed comment is stored in Comment propety.

WriteComment;
         writes a comment stored in Comment into a file in FileName. It
         deletes a comment in this file, replacing by new. If Comment is empty
         string, it will only delete all comments in this file.

WriteCommentTo ( nameoffile : string );
         reads a file from FileName, deletes all comments, inserts new
         comment
         if Comment isn't empty, and stores changed JPG in nameoffile.
         Original file is not changed.

KNOWN BUGS:

-coding style is awful ;-) but i had no time to make it more beautiful...

-cannot support multiple comments. JPG standard does not recommend to place
 more comment blocks in one JPG, but sometimes we can have such a file. Then
 JPGComment will get only last comment block by ReadComment and delete all of
 them by write methods.

-if JPG file is not valid, f.e. it is empty file, JPGComment will raise
 exception.

LICENSE TERMS

This software is free. You may use it in all your projects, commercial or not.
Info about my component will be greatly appreciated. It is provided "as is"
and i cannot be sure if it works 100% properly. Please report about any
problems.

Luke Komsta
Po Box 118
24-100 Pulawy-1
Poland

luke@ariadna.pl

http://www.sp8qed.ampr.org/

