Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
mohan tangella  
#1 Posted : Thursday, September 25, 2014 12:13:18 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi,

im trying to insert IPTC data into an image. i used following code for this.

Code:
var bitmap = new Aurigma.GraphicsMill.Bitmap(imgpath); //input image and output image paths are same(i.e,same image)
var settings = new Aurigma.GraphicsMill.Codecs.JpegSettings();
var iptc = new Aurigma.GraphicsMill.Codecs.IptcDictionary();
string keyWords = "string1" + "," + "string1";
iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Keyword] = keyWords;
settings.Iptc = iptc;
bitmap.Save(imgpath, settings);  //input image and output image paths are same(i.e,same image)


with this code we are losing EXIF,XMP data and image size also decreasing.

i found following link which tells how to preserve data while editing metadata of an image,but the link uses two images i.e reading data from one image and copying image into other location with the changes.we don't want to do that.

http://www.graphicsmill....le-processing-images.htm

my requirement is to write iptc data into an image without losing EXIF,XMP data.
please suggest how can we achieve this.

Thank you.

Edited by moderator Thursday, September 25, 2014 1:02:59 AM(UTC)  | Reason: Not specified

Fedor  
#2 Posted : Thursday, September 25, 2014 1:22:05 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
I recommend you to use the losless JPEG transform approach. In this case the image is not recompressed and its size is not changed. You can find a code example in the method UpdateJpegMetadataLosslessly of the demo
http://www.graphicsmill.com/samples/load-and-save/lossless-jpeg-transforms wrote:
Lossless JPEG Transforms
.

Quote:
i found following link which tells how to preserve data while editing metadata of an image,but the link uses two images i.e reading data from one image and copying image into other location with the changes.we don't want to do that.


You need to save the result to a temp file and then replace the source with the temp file.

Here is a a code example:

Code:
string sourcePath = "../../../../_Input/Chicago.jpg";
string tempPath = System.IO.Path.GetTempPath();

using (var losslessJpeg = new LosslessJpeg(sourcePath))
	{
		//...Metadata manipulation

		losslessJpeg.Write(tempPath);
	}

	System.IO.File.Delete(sourcePath);	
	System.IO.File.Move(tempPath, sourcePath, true);
}

Best regards,
Fedor Skvortsov
mohan tangella  
#3 Posted : Thursday, September 25, 2014 3:29:02 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi Fedor,

Thanks a TON.


The code is working very fine with a small defect.still the image size is reducing .

please check the code.

Code:

          string sourcePath = @"E:\Images\Arnez_Jennifer_120144.jpg";//at this point image size is 60 kb

            using (var losslessJpeg = new Aurigma.GraphicsMill.Codecs.LosslessJpeg(sourcePath))
            {
                // IPTC
                if (losslessJpeg.Iptc == null)
                {
                    losslessJpeg.Iptc = new Aurigma.GraphicsMill.Codecs.IptcDictionary();
                }
                losslessJpeg.Iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Caption] = "Mountain";
                losslessJpeg.Iptc[Aurigma.GraphicsMill.Codecs.IptcDictionary.Caption] = "Mohan;Krishna";

                // EXIF
                if (losslessJpeg.Exif == null)
                {
                    losslessJpeg.Exif = new Aurigma.GraphicsMill.Codecs.ExifDictionary();
                }
                losslessJpeg.Exif[Aurigma.GraphicsMill.Codecs.ExifDictionary.Software] = "Aurigma Graphics Mill";

                // XMP
                var xmp = new Aurigma.GraphicsMill.Codecs.XmpData();
                if (losslessJpeg.Xmp != null)
                {
                    xmp.Load(losslessJpeg.Xmp);
                }
                losslessJpeg.Xmp = xmp.Save();

                losslessJpeg.Write(@"E:\Images\Arnez_Jennifer_120144_1.jpg");//after wrting it is reduced to 47.3 kb
            }

            System.IO.File.Delete(sourcePath);  
            System.IO.File.Move(@"E:\Images\Arnez_Jennifer_120144_1.jpg", sourcePath);

Edited by moderator Thursday, September 25, 2014 3:35:08 AM(UTC)  | Reason: Not specified

File Attachment(s):
Test.rar (37kb) downloaded 10 time(s).
Fedor  
#4 Posted : Thursday, September 25, 2014 3:38:37 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Could you post the image you process?
Best regards,
Fedor Skvortsov
mohan tangella  
#5 Posted : Thursday, September 25, 2014 4:33:30 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
for attachment please check my previous reply.
Fedor  
#6 Posted : Thursday, September 25, 2014 5:45:08 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
I have checked the attached and result image using ExitTool. The JPEG image is not recompressed, however it seems Graphics Mill resaves the embedded thumbnail which causes the reducing of image size.

Our engineers are checking the detailed reason of the problem. I will keep you posted on the progress.
Best regards,
Fedor Skvortsov
thanks 1 user thanked Fedor for this useful post.
mohan tangella on 9/25/2014(UTC)
Fedor  
#7 Posted : Monday, September 29, 2014 7:32:26 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hi,

We have figured out the reason of reducing file size. Graphics Mill recompressed the thumbnail as well as lost some vendor specific EXIF tags.

The problems are fixed now. The update will be available on NuGet next week

Edited by user Monday, September 29, 2014 7:34:29 PM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
mohan tangella  
#8 Posted : Monday, September 29, 2014 8:58:56 PM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi ,

Thank you for much needed help.

you guys are simply awesome.

mohan tangella  
#9 Posted : Monday, October 20, 2014 9:09:45 PM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi,
Sorry to bother you again.

we still didn't get any update through Nuget.

one more thing i want to ask you,we have 7.6.1 key with us ,is it a problem if we use the Dll that we will get through Nuget???
Fedor  
#10 Posted : Tuesday, October 21, 2014 11:14:46 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hi Mohan,

We plan to release the update this week. I will keep you informed of the status.
Best regards,
Fedor Skvortsov
Fedor  
#11 Posted : Friday, October 24, 2014 9:08:25 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
We have just released the update. Please download it from the NuGet respository.
Best regards,
Fedor Skvortsov
mohan tangella  
#12 Posted : Monday, October 27, 2014 11:22:23 PM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi Fedor,


previously we are using Aurigma Graphics Mill x86 (version : 7.0.28.383).

now i tried to install Aurigma Graphics Mill x86 (version : 7.1.76.404) but it is throwing 'File Not Found Exception'

Could not load file or assembly 'Aurigma.GraphicsMill.dll' or one of its dependencies. The specified module could not be found.

after that i tried to install Aurigma Graphics Mill x64 (version : 7.1.76.404) ,which gives following exception

Could not load file or assembly 'Aurigma.GraphicsMill, Version=7.1.76.404, Culture=neutral, PublicKeyToken=f4bbbf243f314012' or one of its dependencies. An attempt was made to load a program with an incorrect format.


how can i use the latest version for my project????

Thank You
Fedor  
#13 Posted : Monday, October 27, 2014 11:28:11 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hi Mohan,

Please try to download and install Microsoft Visual C++ Redistributable Package:

http://www.graphicsmill.com/doc...on-notices.htm#MVPackage

It seems you need the x86 version.

BTW, which version of Visual Studio do you use?
Best regards,
Fedor Skvortsov
mohan tangella  
#14 Posted : Tuesday, October 28, 2014 12:15:10 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi
i have already installed.

i'm using VS2012
Fedor  
#15 Posted : Tuesday, October 28, 2014 2:16:51 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Mohan,

Please download and install the Graphics Mill redistributable package to make sure that you have installed the correct VC++ runtime:

https://www.graphicsmill.com/Dow...sMillRedistributable.exe

Please let me know whether it helps.

Edited by user Tuesday, October 28, 2014 2:31:19 AM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
mohan tangella  
#16 Posted : Tuesday, October 28, 2014 3:03:36 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
Hi ,

this is working.,here what i did.

-uninstalled previous version of redistributable package
-installed the latest version (latest redistributable package )
-given Aurigma.GraphicsMill.dll reference to my project from C:\Program Files (x86)\Aurigma\Graphics Mill 7 Redistributable\.Net 4.0\Binaries_x86


still i'm facing the same issue (reducing image size in kbs) ,could you please check it again.
im attaching image to this post.
File Attachment(s):
Arcadia_Nina_15A0385 (2).rar (73kb) downloaded 10 time(s).
Fedor  
#17 Posted : Wednesday, October 29, 2014 1:27:52 AM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
Hi,

We have checked the problem and it seems the image size is increased a bit.

We have explored the saved JPEG files to make sure that Graphics Mill preserves the EXIF and XML metadata as well as it doesn't recompress the image and its embedded thumbnail. Our tests show that the library works as expected. Even though we discovered that Graphics Mill saves the XML content of the XMP metadata with extra white spaces and it causes the increase of the size.

We will fix it in the further releases, however I hope that this issue is not critical.
Best regards,
Fedor Skvortsov
mohan tangella  
#18 Posted : Wednesday, October 29, 2014 1:33:41 AM(UTC)
mohan tangella

Rank: Member

Groups: Member
Joined: 9/3/2014(UTC)
Posts: 10

Thanks: 1 times
ok

thank you
Users browsing this topic
Forum Jump  
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.