cvs: pecl /iptcdata iptcdata.c

From: Date: Fri, 17 Nov 2006 14:26:37 +0000
Subject: cvs: pecl /iptcdata iptcdata.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6649@lists.php.net to get a copy of this message
crafics Fri Nov 17 14:26:37 2006 UTC Modified files: /pecl/iptcdata iptcdata.c Log: warnings instead of errors, thanks mike and derick http://cvs.php.net/viewvc.cgi/pecl/iptcdata/iptcdata.c?r1=1.2&r2=1.3&diff_format=u Index: pecl/iptcdata/iptcdata.c diff -u pecl/iptcdata/iptcdata.c:1.2 pecl/iptcdata/iptcdata.c:1.3 --- pecl/iptcdata/iptcdata.c:1.2 Fri Nov 17 13:35:10 2006 +++ pecl/iptcdata/iptcdata.c Fri Nov 17 14:26:37 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptcdata.c,v 1.2 2006/11/17 13:35:10 crafics Exp $ */ +/* $Id: iptcdata.c,v 1.3 2006/11/17 14:26:37 crafics Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -58,7 +58,8 @@ IptcData *d; d = iptc_data_new (); if(!d){ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not create new iptc_data"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not create new iptc_data"); + RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, d, le_iptcdata); } @@ -75,6 +76,7 @@ d = iptc_data_new_from_jpeg(filename); if (!d) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not create new iptc_data_new_from_jpeg"); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, d, le_iptcdata); @@ -86,7 +88,8 @@ IptcDataSet *ds; ds = iptc_dataset_new (); if(!ds){ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not create new iptc_data_set"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not create new iptc_data_set"); + RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, ds, le_iptcdataset); } @@ -137,7 +140,8 @@ ZEND_FETCH_RESOURCE(iptcdataset, IptcDataSet*, &ziptcdataset, -1, PHP_IPTCDATASET_RES_NAME, le_iptcdataset); if(iptc_data_add_dataset (iptcdata, iptcdataset)==-1){ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not add dataset"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not add dataset"); + RETURN_FALSE; } RETURN_TRUE; @@ -168,24 +172,28 @@ iptc_data_sort (iptcdata); if (iptc_data_save (iptcdata, &iptc_buf, &iptc_len) < 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not save iptc_data"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not save iptc_data"); + RETURN_FALSE; } ps3_len = iptc_jpeg_ps3_save_iptc (buf, ps3_len, iptc_buf, iptc_len, outbuf, sizeof(outbuf)); iptc_data_free_buf (iptcdata, iptc_buf); if (ps3_len < 0) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to generate PS3 header"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to generate PS3 header"); + RETURN_FALSE; } infile = fopen (filename, "r"); if (!infile) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Can't reopen input file"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Can't reopen input file"); + RETURN_FALSE; } sprintf (tmpfile, "%s.%d", filename, getpid()); outfile = fopen (tmpfile, "w"); if (!outfile) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Can't open temporary file for writing"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Can't open temporary file for writing"); + RETURN_FALSE; } v = iptc_jpeg_save_with_ps3 (infile, outfile, outbuf, ps3_len); @@ -193,13 +201,15 @@ fclose (outfile); if (v < 0) { unlink (tmpfile); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to save image"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to save image"); + RETURN_FALSE; } if (rename (tmpfile, filename) < 0) { fprintf (stderr, "Failed to save image\n"); unlink (tmpfile); - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to save image"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Failed to save image"); + RETURN_FALSE; } RETURN_TRUE; } @@ -234,7 +244,8 @@ d = iptc_data_new_from_jpeg(filename); if (!d) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not create new iptc_data from jpeg"); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Could not create new iptc_data from jpeg"); + RETURN_FALSE; } array_init(return_value);

« previous php.pecl.cvs (#6649) next »