Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entice
Dir : e17/apps/entice/src/bin
Modified Files:
image.c
Log Message:
fix save routines, write to a temp file and rename
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entice/src/bin/image.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- image.c 9 Jan 2004 04:55:05 -0000 1.37
+++ image.c 29 Feb 2004 16:06:49 -0000 1.38
@@ -107,7 +107,7 @@
evas_object_geometry_get(o, &x, &y, &w, &h);
if ((imlib_im =
- imlib_create_image_using_copied_data(iw, ih,
+ imlib_create_image_using_copied_data(im->iw, im->ih,
evas_object_image_data_get
(im->obj, 1))))
{
@@ -116,6 +116,7 @@
im->iw = imlib_image_get_width();
im->ih = imlib_image_get_height();
evas_object_image_size_set(im->obj, im->iw, im->ih);
+ evas_object_image_fill_set(im->obj, 0.0, 0.0, im->iw, im->ih);
evas_object_image_data_copy_set(im->obj,
imlib_image_get_data_for_reading_only
());
@@ -201,6 +202,7 @@
if (im->format && im->filename)
{
char *tmp = NULL;
+ char tmpfile[PATH_MAX];
Imlib_Load_Error err;
imlib_image_set_has_alpha((char)
@@ -208,11 +210,13 @@
imlib_image_attach_data_value("quality", NULL, im->quality, NULL);
if ((tmp = strrchr(im->filename, '.')))
imlib_image_set_format(tmp + 1);
- imlib_save_image_with_error_return(im->filename, &err);
+ snprintf(tmpfile, PATH_MAX, "%s.%d", im->filename, getpid());
+ imlib_save_image_with_error_return(tmpfile, &err);
switch (err)
{
case 0:
- result = 1;
+ if (!rename(tmpfile, im->filename))
+ result = 1;
break;
default:
fprintf(stderr, "Unable to save file(%d)", (int) err);
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs