comparison src/glyphs-eimage.c @ 3734:e1f65870f845

[xemacs-hg @ 2006-12-11 10:04:27 by aidan] 2006-12-11 Aidan Kehoe <kehoea@parhasard.net> * glyphs-eimage.c (png_warning_func): * glyphs-eimage.c (png_instantiate): * glyphs-eimage.c (tiff_warning_func): Decode external binary data as such before passing it to warn_when_safe().
author aidan
date Mon, 11 Dec 2006 10:04:30 +0000
parents ad2f4ae9895b
children 320acec37716
comparison
equal deleted inserted replaced
3733:460f57788910 3734:e1f65870f845
825 } 825 }
826 826
827 static void 827 static void
828 png_warning_func (png_structp UNUSED (png_ptr), png_const_charp msg) 828 png_warning_func (png_structp UNUSED (png_ptr), png_const_charp msg)
829 { 829 {
830 warn_when_safe (Qpng, Qinfo, "%s", msg); 830 DECLARE_EISTRING (eimsg);
831
832 eicpy_ext(eimsg, msg, Qbinary);
833 warn_when_safe (Qpng, Qinfo, "%s", eidata(eimsg));
831 } 834 }
832 835
833 struct png_unwind_data 836 struct png_unwind_data
834 { 837 {
835 FILE *instream; 838 FILE *instream;
1016 */ 1019 */
1017 /* #### I've turned this on, since these warnings are now 1020 /* #### I've turned this on, since these warnings are now
1018 unobtrusive. */ 1021 unobtrusive. */
1019 { 1022 {
1020 int i; 1023 int i;
1024 DECLARE_EISTRING (key);
1025 DECLARE_EISTRING (text);
1021 1026
1022 for (i = 0 ; i < info_ptr->num_text ; i++) 1027 for (i = 0 ; i < info_ptr->num_text ; i++)
1023 { 1028 {
1024 /* How paranoid do I have to be about no trailing NULLs, and 1029 /* How paranoid do I have to be about no trailing NULLs, and
1025 using (int)info_ptr->text[i].text_length, and strncpy and a temp 1030 using (int)info_ptr->text[i].text_length, and strncpy and a temp
1026 string somewhere? */ 1031 string somewhere? */
1032 eireset(key);
1033 eireset(text);
1034 eicpy_ext(key, info_ptr->text[i].key, Qbinary);
1035 eicpy_ext(text, info_ptr->text[i].text, Qbinary);
1027 1036
1028 warn_when_safe (Qpng, Qinfo, "%s - %s", 1037 warn_when_safe (Qpng, Qinfo, "%s - %s",
1029 info_ptr->text[i].key, 1038 eidata(key), eidata(text));
1030 info_ptr->text[i].text);
1031 } 1039 }
1032 } 1040 }
1033 #endif 1041 #endif
1034 1042
1035 xfree (row_pointers, Binbyte **); 1043 xfree (row_pointers, Binbyte **);
1219 #ifdef HAVE_VSNPRINTF 1227 #ifdef HAVE_VSNPRINTF
1220 char warn_str[256]; 1228 char warn_str[256];
1221 #else 1229 #else
1222 char warn_str[1024]; 1230 char warn_str[1024];
1223 #endif 1231 #endif
1232 DECLARE_EISTRING (eimodule);
1233 DECLARE_EISTRING (eiwarnstr);
1224 1234
1225 va_start (vargs, fmt); 1235 va_start (vargs, fmt);
1226 #ifdef HAVE_VSNPRINTF 1236 #ifdef HAVE_VSNPRINTF
1227 vsnprintf (warn_str, 255, fmt, vargs); 1237 vsnprintf (warn_str, 255, fmt, vargs);
1228 #else 1238 #else
1229 vsprintf (warn_str, fmt, vargs); 1239 vsprintf (warn_str, fmt, vargs);
1230 #endif 1240 #endif
1231 va_end (vargs); 1241 va_end (vargs);
1242
1243 eicpy_ext(eimodule, module, Qbinary);
1244 eicpy_ext(eiwarnstr, warn_str, Qbinary);
1245
1232 warn_when_safe (Qtiff, Qinfo, "%s - %s", 1246 warn_when_safe (Qtiff, Qinfo, "%s - %s",
1233 module, warn_str); 1247 eidata(eimodule),
1248 eidata(eiwarnstr));
1234 } 1249 }
1235 1250
1236 static void 1251 static void
1237 tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, 1252 tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
1238 Lisp_Object pointer_fg, Lisp_Object pointer_bg, 1253 Lisp_Object pointer_fg, Lisp_Object pointer_bg,