Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, August 14, 2009 9:13:27 PM(UTC)

Sony  
Sony

Groups: Registered
Posts: 1


Hi

I am using leadtools .net eval version 16.5.

Using my application i need to

1. Resize the image
2. Read exif data from the original image
3. Write exif data to the resized images. These images i will use in my another application.

I am using .jpeg images. I can able to resize the images, read exif data and write exif data also.
The problem is that ' i cant use my resized images in my another applocation in asp.net'. Its not showing in my
image controls like <asp:image.
Actually the problem arised after writing the exif data. So the problem is in write exif data.
For writing exif data i used the code :

RasterCodecs.Startup();

RasterCodecs codecs = new RasterCodecs();

codecs.ThrowExceptionsOnInvalidImages = true;

// Load the image

RasterImage image = codecs.Load(destFileName);

codecs.Save(image, destFileName, RasterImageFormat.Tif, 24);

image.Dispose();

// Write some comments to the existing tif file

RasterCommentMetadata comment = new RasterCommentMetadata();

if (Program.exifDate != DefaultDT)

{

comment.Type = RasterCommentMetadataType.DateTime;

comment.FromAscii(Program.exifDate.ToString());

codecs.WriteComment(destFileName, 1, comment);

}

RasterMetadataRational[] rationalsWrite = new RasterMetadataRational[3];

if (Program.exifLatitude.Length == 3)

{

comment.Type = RasterCommentMetadataType.GpsLatitude;

for (int i = 0; i < rationalsWrite.Length; i++)

{

rationalsWrite[i] = Program.exifLatitude[i];

}

comment.FromRational(rationalsWrite);

codecs.WriteComment(destFileName, 1, comment);

}

if (Program.exifLongtitude.Length == 3)

{

comment.Type = RasterCommentMetadataType.GpsLongitude;

rationalsWrite = new RasterMetadataRational[3];

for (int i = 0; i < rationalsWrite.Length; i++)

{

rationalsWrite[i] = Program.exifLongtitude[i];

}

comment.FromRational(rationalsWrite);

codecs.WriteComment(destFileName, 1, comment);

}

if (Program.exifElevation != string.Empty)

{

comment.Type = RasterCommentMetadataType.GpsSatellites;

comment.FromAscii(Program.exifElevation);

codecs.WriteComment(destFileName, 1, comment);

}

Here we are saving the images to destination file in RasterImageFormat.Tif format.
And then writing the exif data. Once its done, from here after i cant load the image using image tool from asp.net application.

I tried to save the image back to jpeg format, then the image is loading to asp:image control but the written exif data got missed.
I tried to write exif data to the jpeg image using RasterImageFormat.Jpeg format then i am getting the
error "JPEG marker is missing".

Actually i am in delema. I want a solution to move further.
Thanks in advance.

Thanks & Regards
Sony A N
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Sunday, August 16, 2009 1:28:21 AM(UTC)

Adnan Ismail  
Guest

Groups: Guests
Posts: 3,034

Was thanked: 2 time(s) in 2 post(s)

Sony,
Did you try to save using one of these formats:
- RasterImageFormat.Exif
- RasterImageFormat.ExifJpeg
- RasterImageFormat.ExifJpeg411
- RasterImageFormat.ExifJpeg422
If you save your files to RasterImageFormat.Tif or RasterImageFormat.Jpeg, the resulting files will not have data written in them.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.153 seconds.