mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 02:30:11 +01:00
pdf: fix embedding of mime data that has been broken since 0a10982f
For some reason the mime-data test is not detecting this failure.
This commit is contained in:
parent
5390c2bbca
commit
266d6e7156
1 changed files with 12 additions and 11 deletions
|
|
@ -2663,6 +2663,18 @@ _cairo_pdf_surface_emit_image_surface (cairo_pdf_surface_t *surface,
|
|||
void *image_extra;
|
||||
cairo_int_status_t status;
|
||||
|
||||
if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
if (!source->hash_entry->stencil_mask) {
|
||||
status = _cairo_pdf_surface_emit_jpx_image (surface, source->surface, source->hash_entry->surface_res);
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
|
||||
status = _cairo_pdf_surface_emit_jpeg_image (surface, source->surface, source->hash_entry->surface_res);
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
if (source->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
status = _cairo_surface_acquire_source_image (source->surface, &image, &image_extra);
|
||||
} else {
|
||||
|
|
@ -2672,22 +2684,11 @@ _cairo_pdf_surface_emit_image_surface (cairo_pdf_surface_t *surface,
|
|||
if (unlikely (status))
|
||||
return status;
|
||||
|
||||
if (!source->hash_entry->stencil_mask) {
|
||||
status = _cairo_pdf_surface_emit_jpx_image (surface, &image->base, source->hash_entry->surface_res);
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
goto release_source;
|
||||
|
||||
status = _cairo_pdf_surface_emit_jpeg_image (surface, &image->base, source->hash_entry->surface_res);
|
||||
if (status != CAIRO_INT_STATUS_UNSUPPORTED)
|
||||
goto release_source;
|
||||
}
|
||||
|
||||
status = _cairo_pdf_surface_emit_image (surface, image,
|
||||
&source->hash_entry->surface_res,
|
||||
source->hash_entry->interpolate,
|
||||
source->hash_entry->stencil_mask);
|
||||
|
||||
release_source:
|
||||
if (source->type == CAIRO_PATTERN_TYPE_SURFACE)
|
||||
_cairo_surface_release_source_image (source->surface, image, image_extra);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue