va_end (ap);
}
+static void
+image_invalid_data_error (Lisp_Object data)
+{
+ image_error ("Invalid image data `%s'", data);
+}
+
+static void
+image_not_found_error (Lisp_Object filename)
+{
+ image_error ("Cannot find image file `%s'", filename);
+}
+
static void
image_size_error (void)
{
if (*pixmap == NO_PIXMAP)
{
*pimg = NULL;
- image_error ("Unable to create X pixmap", Qnil, Qnil);
- return 0;
+ image_error ("Unable to create X pixmap");
+ return false;
}
*pimg = *pixmap;
if (*pixmap == NO_PIXMAP)
{
*pimg = NULL;
- image_error ("Unable to create pixmap", Qnil, Qnil);
- return 0;
+ image_error ("Unable to create pixmap");
+ return false;
}
*pimg = *pixmap;
Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", file_name);
- return 0;
+ image_not_found_error (file_name);
+ return false;
}
ptrdiff_t size;
Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", specified_file);
+ image_not_found_error (specified_file);
#ifdef ALLOC_XPM_COLORS
xpm_free_color_cache ();
#endif
SAFE_FREE ();
- return 0;
+ return false;
}
file = ENCODE_FILE (file);
Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
if (!STRINGP (buffer))
{
- image_error ("Invalid image data `%s'", buffer);
+ image_invalid_data_error (buffer);
#ifdef ALLOC_XPM_COLORS
xpm_free_color_cache ();
#endif
Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", file_name);
- return 0;
+ image_not_found_error (file_name);
+ return false;
}
ptrdiff_t size;
data = image_spec_value (img->spec, QCdata, NULL);
if (!STRINGP (data))
{
- image_error ("Invalid image data `%s'", data);
- return 0;
+ image_invalid_data_error (data);
+ return false;
}
success_p = xpm_load_image (f, img, SSDATA (data),
SSDATA (data) + SBYTES (data));
Lisp_Object file = image_find_image_fd (specified_file, &fd);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", specified_file);
- return 0;
+ image_not_found_error (specified_file);
+ return false;
}
ptrdiff_t size;
data = image_spec_value (img->spec, QCdata, NULL);
if (!STRINGP (data))
{
- image_error ("Invalid image data `%s'", data);
- return 0;
+ image_invalid_data_error (data);
+ return false;
}
p = SSDATA (data);
end = p + SBYTES (data);
|| (fd = emacs_open (SSDATA (ENCODE_FILE (file)),
O_RDONLY, 0)) < 0)
{
- image_error ("Cannot find image file `%s'", specified_file);
- return 0;
+ image_not_found_error (specified_file);
+ return false;
}
/* Open the image file. */
{
if (!STRINGP (specified_data))
{
- image_error ("Invalid image data `%s'", specified_data);
- return 0;
+ image_invalid_data_error (specified_data);
+ return false;
}
/* Read from memory. */
|| (fd = emacs_open (SSDATA (ENCODE_FILE (file)),
O_RDONLY, 0)) < 0)
{
- image_error ("Cannot find image file `%s'", specified_file);
- return 0;
+ image_not_found_error (specified_file);
+ return false;
}
fp = emacs_fdopen (fd, "rb");
}
else if (!STRINGP (specified_data))
{
- image_error ("Invalid image data `%s'", specified_data);
- return 0;
+ image_invalid_data_error (specified_data);
+ return false;
}
/* Customize libjpeg's error handling to call my_error_exit when an
Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", specified_file);
- return 0;
+ image_not_found_error (specified_file);
+ return false;
}
Lisp_Object encoded_file = ENCODE_FILE (file);
{
if (!STRINGP (specified_data))
{
- image_error ("Invalid image data `%s'", specified_data);
- return 0;
+ image_invalid_data_error (specified_data);
+ return false;
}
/* Memory source! */
Lisp_Object file = image_find_image_file (specified_file);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", specified_file);
+ image_not_found_error (specified_file);
return false;
}
{
if (!STRINGP (specified_data))
{
- image_error ("Invalid image data `%s'", specified_data);
+ image_invalid_data_error (specified_data);
return false;
}
file = image_find_image_fd (specified_file, &fd);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", specified_file);
+ image_not_found_error (specified_file);
return false;
}
{
if (!STRINGP (specified_data))
{
- image_error ("Invalid image data `%s'", specified_data);
+ image_invalid_data_error (specified_data);
return false;
}
contents = SDATA (specified_data);
Lisp_Object file = image_find_image_file (file_name);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", file_name);
- return 0;
+ image_not_found_error (file_name);
+ return false;
}
file = ENCODE_FILE (file);
#ifdef WINDOWSNT
data = image_spec_value (img->spec, QCdata, NULL);
if (!STRINGP (data))
{
- image_error ("Invalid image data `%s'", data);
- return 0;
+ image_invalid_data_error (data);
+ return false;
}
success_p = imagemagick_load_image (f, img, SDATA (data),
SBYTES (data), NULL);
Lisp_Object file = image_find_image_fd (file_name, &fd);
if (!STRINGP (file))
{
- image_error ("Cannot find image file `%s'", file_name);
- return 0;
+ image_not_found_error (file_name);
+ return false;
}
/* Read the entire file into memory. */
data = image_spec_value (img->spec, QCdata, NULL);
if (!STRINGP (data))
{
- image_error ("Invalid image data `%s'", data);
- return 0;
+ image_invalid_data_error (data);
+ return false;
}
if (!STRINGP (base_uri))
base_uri = BVAR (current_buffer, filename);