Welcome Guest Search | Active Topics | Members

Using LosslessJpegTransform Options
bdavi19
Posted: Thursday, March 23, 2006 10:52:36 AM
Rank: Member
Groups: Member

Joined: 3/23/2006
Posts: 8
Points: 0
I would like to be able to rotate a jpeg and write it back to the same file. My code looks something like this:

Code:
Aurigma.GraphicsMill.Codecs.LosslessJpegTransform trans = new Aurigma.GraphicsMill.Codecs.LosslessJpegTransform();

trans.Open(item.Pidl.Path);
trans.WriteRotated(item.Pidl.Path, System.Drawing.RotateFlipType.Rotate90FlipNone);
trans.Close();


When I get to the WriteRotated command, an error is thrown because the file is being used by another process (trans.Open). I'm sure I can figure out a work around, but I just wanted to make sure I wasn't missing a step.

Thanks,
Brad
Dmitry
Posted: Thursday, March 23, 2006 8:43:09 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 587
Points: 591
Hello Brad,

Unfortunately you cannot load and save an image from/into the same file. In your case you should save your result image into temporary file and then rename it to file name which you need.

Sincerely yours,
Dmitry Sevostyanov.
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.