Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : libs/epsilon
Dir : e17/libs/epsilon/src/lib
Modified Files:
Epsilon.c
Log Message:
check epeg return values
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/epsilon/src/lib/Epsilon.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Epsilon.c 17 Oct 2004 17:53:05 -0000 1.10
+++ Epsilon.c 1 Feb 2005 03:24:11 -0000 1.11
@@ -349,6 +349,7 @@
epsilon_generate (Epsilon * e)
{
int iw, ih;
+ int tw = THUMBNAIL_SIZE, th = THUMBNAIL_SIZE;
char outfile[PATH_MAX];
#ifdef HAVE_EPEG_H
Epeg_Image *im;
@@ -368,23 +369,24 @@
getenv ("HOME"), e->hash);
epeg_thumbnail_comments_get (im, &info);
epeg_size_get (im, &iw, &ih);
- if (iw > ih)
- {
- epeg_decode_size_set (im, THUMBNAIL_SIZE,
- THUMBNAIL_SIZE * ((double) ih / (double) iw));
- }
- else
- {
- epeg_decode_size_set (im,
- THUMBNAIL_SIZE * ((double) iw / (double) ih),
- THUMBNAIL_SIZE);
- }
+ if (iw > ih)
+ {
+ th = THUMBNAIL_SIZE * ((double) ih / (double) iw);
+ }
+ else
+ {
+ tw = THUMBNAIL_SIZE * ((double) iw / (double) ih);
+ }
+ epeg_decode_size_set (im, tw, th);
epeg_quality_set (im, 100);
epeg_thumbnail_comments_enable (im, 1);
epeg_file_output_set (im, outfile);
- epeg_encode (im);
+ if(!epeg_encode (im))
+ {
+ epeg_close (im);
+ return (EPSILON_OK);
+ }
epeg_close (im);
- return (EPSILON_OK);
}
#endif
{
@@ -394,7 +396,6 @@
struct stat filestatus;
Imlib_Image tmp = NULL;
Imlib_Image src = NULL;
- int tw = THUMBNAIL_SIZE, th = THUMBNAIL_SIZE;
if (stat (e->src, &filestatus) != 0)
return (EPSILON_FAIL);
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs