Dear Ron Savage,

using a comment string was the right hint for writing
the comment. Below are the solutions for my problem
about writing and reading. I will also update the four tile
generation programs. Thank you very much!

Günter







####################Assign variables to string and write
comment#######################################
use Image::Magick;
$pmm = new Image::Magick;

$sourcefile_name = 'image.jpg';
$p = '1';

$pmm->Read("$sourcefile_name");

$rectangle_width = '1373';
$rectangle_height = '1985';
$x1 = '839';
$y1 = '131';

$comment_string = $sourcefile_name . "*" . $rectangle_width . "*" .
$rectangle_height  . "*" . $x1 . "*" . $y1 . "*");
$pmm_comment = $pmm->Comment($comment_string);


chop $sourcefile_name;
chop $sourcefile_name;
chop $sourcefile_name;
chop $sourcefile_name;

$resultimage_name = "pmm_" . $sourcefile_name . "-0" . $p . ".jpg";

$pmm->Write(filename=>"$resultimage_name", compression=>'JPEG',
quality=>'95');





####################Read comment and assign to variables
#######################################
use Image::Magick;
$image = new Image::Magick;

$image->Read("$resultimage_name");

$comment_string = $image->Get('comment');

@comment_list = split(/\*/, $comment_string);

$sourcefile_name = @comment_list[0];
$rectangle_width = @comment_list[1];
$rectangle_height = @comment_list[2];
$x1 = @comment_list[3];
$y1 = @comment_list[4];


_______________________________________________
Magick-users mailing list
Magick-users@imagemagick.org
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to