On Fri, Jul 17, 2009 at 08:33:02PM +0200, Frank van Maarseveen wrote:
> On Tue, Jul 14, 2009 at 06:28:36AM +0200, Niels Kristian Bech Jensen wrote:
> > 
> > > Date: Sun, 12 Jul 2009 11:11:05 +0200
> > > From: [email protected]
> > > To: [email protected]
> > > Subject: [UFRaw-Devel] loading/saving ID file with createid==only doesn't 
> > > work
> > > 
> > > When the ID file specifies createID==only_id as in
> > > 
> > >   <CreateID>2</CreateID>
> > > 
> > > and I fire up ufraw with this ID file as argument then the save button
> > > does not behave as expected: it also converts and saves the image. It
> > > appears that ufraw silently decides to replace "only_id" by "also_id"
> > > when read from an ID file, see around line 162 in ufraw_ufraw.c
> > > 
> > > >From the outside this looks like a bug because ufraw is just not doing
> > > what it has been told. Is there any special reason for this "magic"
> > > or can we just remove it?
> > > 
> > ... seems the code is needed to get ufraw-batch to save the image file when 
> > given a ID file as input.
> 
> IMHO, these kind of magic decisions underneath (though it superficially
> may seem a good thing to do) is not helping at all on the long term
> where it will be perceived as a bug/stubborn behavior or just illogic.
> 
> Anyway, here is take 2 of the patch. Essentially it makes the old
> behavior ufraw-batch specific (apparently ufraw-batch.c itself assumes
> this particular behavior):

[...]

The ID file CreateID promotion issue is also present in the --create-id
option and I just got bitten by it.

When ufraw-batch is used as a preparational step for anything else
then the image output generation not only is redundant but takes a
disproportional amount of time. So the --create-id=only option is useful
even for ufraw-batch but it doesn't work. Fix:

diff --git a/ufraw-batch.c b/ufraw-batch.c
index 79f77c3..85c989c 100644
--- a/ufraw-batch.c
+++ b/ufraw-batch.c
@@ -86,8 +86,6 @@ int main (int argc, char **argv)
            continue;
        }
        status = ufraw_config(uf, &rc, &conf, &cmd);
-       if (uf->conf && uf->conf->createID == only_id)
-           uf->conf->createID = also_id;
        if (status==UFRAW_ERROR) {
            exitCode = 1;
            ufraw_close(uf);
@@ -107,10 +105,11 @@ int main (int argc, char **argv)
            stat[0] = '\0';
        ufraw_message(UFRAW_MESSAGE, _("Loaded %s%s"), uf->filename, stat);
        status = ufraw_batch_saver(uf);
-       if (status==UFRAW_SUCCESS || status==UFRAW_WARNING)
-           ufraw_message(UFRAW_MESSAGE, _("Saved %s%s"),
-                   uf->conf->outputFilename, stat);
-       else
+       if (status==UFRAW_SUCCESS || status==UFRAW_WARNING) {
+           if (uf->conf->createID!=only_id)
+               ufraw_message(UFRAW_MESSAGE, _("Saved %s%s"),
+                       uf->conf->outputFilename, stat);
+        } else
            exitCode = 1;
        ufraw_close(uf);
        g_free(uf);
diff --git a/ufraw.h b/ufraw.h
index ce85436..dc1e287 100644
--- a/ufraw.h
+++ b/ufraw.h
@@ -152,7 +152,6 @@ typedef struct {
  * CONF|ID: curve/profile are added to the list from RC.
  * CONF: inputFilename, outputFilename are ignored.
  * outputPath can only be specified in CMD or guessed in interactive mode.
- * ID: createID==only_id is switched to also_id in case of ufraw-batch.
  * ID: chanMul[] override wb, green, temperature.
  */
 typedef struct {


-- 
Frank

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
ufraw-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-devel

Reply via email to