Re: Crash on rotate image



>From the trace it looks like the exception is being thrown here (from
JpegUtils.cs)

if (! f_transform_jpeg (source_path, destination_path, transform, ref
error_message))
	throw new Exception (error_message);

That should only happen if the return of f_transform_jpeg gets converted
to false. That would happen if TRUE is picking up the value 0 from
somewhere. Try the attached patch against a fresh copy of the source. It
will print out the value of TRUE. If it is 1 (or just not 0) as it
should be, then that would suggest a problem with mono's C interop
stuff. If it is 0, then there is something odd in your build
environment. The patch should also print a line if the exception is
about to get thrown, that would rule out the File.Delete stuff.

I can't help feeling I'm missing something obvious though.

cheers

Loz


On Fri, 2005-01-28 at 13:31 +0000, Matthew Kay wrote:
> On Fri, 2005-01-28 at 12:49 +0000, Laurence Hygate wrote:
> > Thanks for trying all this out, by the way.
> 
> No worries - wouldn't bother if I didn't like the program!
> 
> > I've attached another patch to try if you would. I can't see how
> > f_transform_jpeg can return without setting an error or being true.
> 
> Applied - all looks good. Perhaps something is going wrong after this
> function since we do get a rotated image (.jpg.tmp) created and I get
> this output with the new patch:
> 
> (F-Spot:19343): libf-WARNING **: About to return true...
> 
> Could it be that we are getting to
> 	File.Delete (original_path);
> 	File.Move (temporary_path, original_path);
> ...but that there is some problem with these functions, though they seem
> perfectly sensible?
> 
> M
> 
-- 
Laurence Hygate <loz flower powernet co uk>
Index: libfspot/f-jpeg-utils.c
===================================================================
RCS file: /cvs/gnome/f-spot/libfspot/f-jpeg-utils.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 f-jpeg-utils.c
--- libfspot/f-jpeg-utils.c	8 Nov 2003 06:52:42 -0000	1.1.1.1
+++ libfspot/f-jpeg-utils.c	29 Jan 2005 19:41:38 -0000
@@ -457,6 +457,11 @@ f_transform_jpeg  (const char      *sour
 	if (transform == F_JPEG_TRANSFORM_ROTATE_270
 	    || transform == F_JPEG_TRANSFORM_ROTATE_90)
 		swap_xy_exif_fields (destination_path);
+	{
+		char *msg = g_strdup_printf("About to return TRUE. TRUE=%i", TRUE);
+		g_warning(msg);
+		g_free(msg);
+	}
 
 	return TRUE;
 }
Index: src/JpegUtils.cs
===================================================================
RCS file: /cvs/gnome/f-spot/src/JpegUtils.cs,v
retrieving revision 1.2
diff -u -p -r1.2 JpegUtils.cs
--- src/JpegUtils.cs	30 Nov 2004 09:03:12 -0000	1.2
+++ src/JpegUtils.cs	29 Jan 2005 19:41:38 -0000
@@ -53,7 +53,9 @@ public class JpegUtils {
 	{
 		string error_message = null;
 
-		if (! f_transform_jpeg (source_path, destination_path, transform, ref error_message))
+		if (! f_transform_jpeg (source_path, destination_path, transform, ref error_message)) {
+			System.Console.WriteLine ("About to throw exception");
 			throw new Exception (error_message);
+		}
 	}
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]