summaryrefslogtreecommitdiff
path: root/src/image.c
Commit message (Collapse)AuthorAge
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-01
|
* Fix SVG scaling (bug#59802)Manuel Giraud2022-12-16
| | | | | | | | Fix SVG scaling with librsvg>2.52 and SVG file with only one known dimension. * src/image.c (svg_load_image): Compute a percentage dimension with the other known dimension.
* Remove unused parameter from image_create_pix_containerStefan Kangas2022-11-25
| | | | | * src/image.c (image_create_pix_container): Remove unused frame parameter. Update callers.
* ; * src/image.c (syms_of_image): Add missed part of change.Po Lu2022-11-06
| | | | Author:
* Fix splash screen display on NS and Haiku with native image APIsPo Lu2022-11-06
| | | | | * src/image.c (syms_of_image): Add Qsvg image type if SVG is also supported by native image APIs.
* Fix leaks of XImage structures in image.cPo Lu2022-11-01
| | | | | | | | * src/image.c (image_clear_image, lookup_image): Fix coding style. (x_destroy_x_image): Remove unnecessary assertion. Call XDestroyImage, since otherwise only the image data is freed. (image_from_emacs_colors): Rename variables to make more sense.
* Move imagep in image.c from the debugging sectionLars Ingebrigtsen2022-09-13
| | | | | * lisp/simple.el (imagep): Remove. * src/image.c (Fimagep): Always define.
* ; * src/image.c (svg_load_image): Another minor cleanup. (Bug#51104)Eli Zaretskii2022-09-13
|
* ; * src/image.c (svg_load_image): Always free 'err' if non-NULL.Eli Zaretskii2022-09-13
|
* Fix last change in image.cEli Zaretskii2022-09-13
| | | | | | | | * src/image.c (svg_load_image): Don't call Lisp to remove trailing whitespace from librsvg error messages, do it in C instead; this reduces consing and is much cleaner. Don't display empty error reason if librsvg happens to return an empty message text. (syms_of_image): Don't DEFSYM string-trim-right. (Bug#57755)
* Avoid double svg error reporting and segfaultsdickmao2022-09-13
| | | | | | | | | * src/image.c (svg_load_image): Use g_error_free directly instead of the helder g_clear_error (since we're only calling it with non-nil values). (svg_load_image): Avoid segfault and double reporting errors. * test/manual/image-tests.el (image-tests-load-image/svg-too-big) (image-tests-load-image/svg-invalid): Test it (bug#57755).
* Display librsvg error when loading bad SVGStefan Kangas2022-09-09
| | | | | | | * src/image.c (svg_load_image): Display the error message from librsvg when parsing a bad SVG image file. * test/manual/image-tests.el (image-tests-load-image/svg-invalid): New test.
* Prune animation cache when images are no longer reachableLars Ingebrigtsen2022-07-14
| | | | | | | | | | | * lisp/image.el (image-animate-timeout): Eject cached animated images that are no longer reachable (bug#56546). * src/image.c (Fclear_image_cache): Allow specifying a cached animated image to eject. (gif_load, webp_load): Adjust what to use as the caching key -- the identity of the list itself is apparently changed by some callers.
* Make image-cache-size also include the animation cacheLars Ingebrigtsen2022-07-14
| | | | | | | * src/image.c (struct anim_cache, anim_create_cache): Store approx cache size. (gif_load, webp_load): Ditto. (Fimage_cache_size): Also report animation cache size (bug#56546).
* Pacify -Wunused-macros in --without-all buildsStefan Kangas2022-07-14
| | | | * src/image.c (IMAGE_TYPE_INIT): Make conditional on image support.
* Make clear-image-cache clear the animation cacheLars Ingebrigtsen2022-07-14
| | | | | | | | | | | | * src/dispextern.h: Declare image_prune_animation_caches for use in gc. * src/image.c (Fclear_image_cache): Clear animation cache. (anim_prune_animation_cache, anim_get_animation_cache): Allow clearing in addition to pruning. (imagemagick_prune_animation_cache) (imagemagick_get_animation_cache): Ditto. (image_prune_animation_caches): New function (bug#56546).
* Allow plist-get/plist-put/plist-member to take a comparison functionLars Ingebrigtsen2022-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/lists.texi (Plist Access): Document it. * lisp/filesets.el (filesets-reset-fileset) (filesets-ingroup-cache-get): (filesets-ingroup-cache-put): (filesets-build-menu-now): Don't use lax-plist functions. * lisp/simple.el (lax-plist-put, lax-plist-get): Moved here from fns.c and make obsolete. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Don't mark plist functions as side-effect-free or pure. * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Adjust type. * lisp/emacs-lisp/shortdoc.el (list): Don't document deprecated functions. * src/xdisp.c (build_desired_tool_bar_string): (display_mode_element): (store_mode_line_string): (display_string): (produce_stretch_glyph): (note_mode_line_or_margin_highlight): (note_mouse_highlight): * src/w32.c (serial_configure): * src/sysdep.c (serial_configure): * src/sound.c (parse_sound): * src/process.c (Fset_process_buffer): (Fset_process_sentinel): (Fprocess_contact): (Fmake_process): (Fmake_pipe_process): (Fset_network_process_option): (Fserial_process_configure): (Fmake_serial_process): (set_network_socket_coding_system): (finish_after_tls_connection): (connect_network_socket): (Fmake_network_process): (server_accept_connection): * src/lread.c (ADDPARAM): (hash_table_from_plist): * src/keyboard.c (make_lispy_position): * src/indent.c (check_display_width): * src/image.c (postprocess_image): * src/gnutls.c (gnutls_verify_boot): (Fgnutls_boot): (gnutls_symmetric): (Fgnutls_hash_mac): (Fgnutls_hash_digest): * src/dired.c (filter): * src/data.c (add_to_function_history): * src/coding.c (Fcoding_system_put): Adjust callers from Fplist_put (etc) to plist_put. * src/fns.c (plist_get): (plist_put): (plist_member): New functions (without optional third parameter) to be used in C code. * src/fns.c (Fplist_get, Fplist_put, Fplist_member): Take an optional predicate parameter (bug#47425). * src/lisp.h: Declare new plist_put, plist_get and plist_member functions. * test/lisp/json-tests.el (test-json-add-to-plist): Use plist-get. * test/src/fns-tests.el (test-cycle-lax-plist-get): (test-cycle-lax-plist-put): (lax-plist-get/odd-number-of-elements): (test-plist): Remove lax-plist tests, since semantics have changed (they no longer error out on cycles).
* Implement image transform smoothing on HaikuPo Lu2022-06-25
| | | | | | | | | * src/dispextern.h (struct image): New field `use_bilinear_filtering'. * src/haiku_draw_support.cc (BView_DrawBitmap): Accept it. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_draw_image_glyph_string): * src/image.c (image_set_transform): Set it.
* Implement "flip" image transforms on HaikuPo Lu2022-06-25
| | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct image): New field `transform', `original_width' and `original_height'. * src/haiku_draw_support.cc (BView_DrawMask): Rename to `be_draw_image_mask' and fix coding style. (rotate_bitmap_270, BBitmap_transform_bitmap, rotate_bitmap_90): Delete functions. (be_apply_affine_transform): New function. (be_apply_inverse_transform): New function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (haiku_translate_transform): New function. (haiku_draw_image_glyph_string): Use affine transforms to implement images. * src/image.c (image_set_transform): Implement using affine transforms on Haiku too.
* Add support for image flippingTimo Taipalus2022-06-24
| | | | | | | | | | | | | | * lisp/image.el (image-map): Keybindings for flipping functions. (image-flip-horizontally): New function that toggles image flipping property. (image-flip-vertically): New function that toggles image flipping property and rotates image 180 degrees. * src/image.c (syms_of_image): Add property. (image_set_transform): Modify image rotation code to also horizontally flip the image when the property is set. * etc/NEWS: Add description. * doc/lispref/display.texi (Image Descriptors): Document :flip (bug#47095).
* Allow using :width/:height as normal with xbm imagesLars Ingebrigtsen2022-06-20
| | | | | | | | | * doc/lispref/display.texi (XBM Images): Adjust the documentation. * src/image.c (enum xbm_keyword_index): Add :data-width and :data-height. (xbm_format): Ditto. (xbm_image_p): Allow passing in :width/:height for display. (xbm_load): Use :data-width/:data-height.
* Implement `cross-disabled-images' on HaikuPo Lu2022-05-20
| | | | | | | | | | * src/haiku_draw_support.cc (be_draw_cross_on_pixmap_1) (be_draw_cross_on_pixmap): New functions. * src/haiku_support.h: Update prototypes. * src/image.c (image_pixmap_draw_cross, image_disable_image): Implement drawing cross on Haiku.
* ; Fix typosStefan Kangas2022-05-15
|
* Fix searching the bitmap file path on HaikuPo Lu2022-05-12
| | | | | * src/image.c (image_create_bitmap_from_file): [HAVE_HAIKU]: Look for the bitmap inside `x-bitmap-file-path' as well.
* Fix stipple bitmap caching on HaikuPo Lu2022-05-09
| | | | | * src/image.c (image_create_bitmap_from_file): Set file name on the bitmap rec on Haiku.
* Fix file-based stipple on NSPo Lu2022-05-08
| | | | | * src/image.c (image_create_bitmap_from_file) [HAVE_NS]: Fix loading XBM data from file.
* Fully implement stipples for text on HaikuPo Lu2022-05-08
| | | | | | | | | | | | | | | | | | | | | | * src/haikufont.c (haikufont_draw): Use `haiku_draw_background_rect' instead. * src/haikuterm.c (haiku_draw_plain_background): Change arguments to accept rect manually. (haiku_get_bitmap): Delete function. (haiku_get_bitmap_rec): New function. (haiku_draw_stipple_background): Accept rect instead of box sizes. (haiku_draw_background_rect): New function. (haiku_maybe_draw_background): Use that instead. (haiku_draw_image_glyph_string): Add notice. (haiku_draw_glyph_string): Set `stippled_p' correctly. * src/haikuterm.h (struct haiku_bitmap_record): New fields for keeping track of stipple state. * src/image.c (image_create_bitmap_from_data) (image_create_bitmap_from_file, free_bitmap_record): Free and set them accordingly.
* Implement bitmap loading for faces on HaikuPo Lu2022-05-08
| | | | | | | | | | | | | | | | | | | | | | | | | | Stipples don't completely work yet. * lisp/faces.el (face-valid-attribute-values): Enable `:stipple' on Haiku. * src/haiku_draw_support.cc (BView_DrawBitmap) (BView_DrawBitmapWithEraseOp, BView_DrawMask): Don't push and pop states. (BView_DrawBitmapTiled): New function. * src/haiku_support.cc (BBitmap_import_mono_bits): Delete function. * src/haiku_support.h: Update prototypes. * src/haikuterm.c (get_string_resource): Fix coding style. (haiku_get_bitmap, haiku_draw_stipple_background): Implement partially. (haiku_set_scroll_bar_default_width) (haiku_set_scroll_bar_default_height, haiku_scroll_bar_create) (haiku_set_horizontal_scroll_bar, haiku_set_vertical_scroll_bar) (haiku_create_terminal, haiku_scroll_bar_remove): Fix coding style. * src/image.c (image_create_bitmap_from_data) (image_create_bitmap_from_file): Implement on Haiku.
* Make the SVG error message less verboseLars Ingebrigtsen2022-04-13
| | | | | | * src/image.c (svg_load_image): Don't include the spec in the error message, because this is commonly the entire SVG string, and this will fill up the *Messages* buffer quickly.
* Improve DISPOSE_PREVIOUS in gif_load slightlyLars Ingebrigtsen2022-04-12
| | | | | * src/image.c (gif_load): Tweak how DISPOSE_PREVIOUS is handled. It's still not right, but it's less glaringly wrong.
* Fix webp_load data lifetime issuesLars Ingebrigtsen2022-04-12
| | | | | * src/image.c (webp_load): Take care of lifetime issues of the image data we're iterating over for animated images.
* Fix check for whether frames fit into gif imagesLars Ingebrigtsen2022-04-12
| | | | * src/image.c (gif_load): Really check all frames that they fit.
* Store less data in the gif animation cacheLars Ingebrigtsen2022-04-12
| | | | | * src/image.c (gif_load): Only start a cache if we're have an :index entry (which means that we're trying to animate something).
* Release resources in gif_load on errorsLars Ingebrigtsen2022-04-12
| | | | | * src/image.c (webp_load): Clean up code slightly. (gif_load): Really release resources on GIF parsing errors.
* Animate GIF images that don't have an explicit delay settingLars Ingebrigtsen2022-04-12
| | | | | * src/image.c (gif_load): Use the default delay for GIF images that don't explicitly state a delay.
* Fix thinko in the anim cacheLars Ingebrigtsen2022-04-12
| | | | | | * src/image.c (gif_load): Fix resetting the cache when we're out of sync. (anim_create_cache): Start from zero, not 1.
* Make normal image caching actually work when doing animated imagesLars Ingebrigtsen2022-04-11
| | | | | | | * src/image.c (filter_image_spec): New function. (uncache_image): Use it. (lookup_image): Ditto. (syms_of_image): Define some keywords.
* ; * src/image.c: move #endif to correct placeMattias EngdegÄrd2022-04-11
|
* Make gif_load work across architectures againLars Ingebrigtsen2022-04-11
| | | | | | | * src/image.c (gif_load): Invert the way animated pixmaps are created: Work on the cached computed-so-far pixmap, and then copy the entire thing to the ximg with PUT_PIXEL at the end. This should work across platforms, which the previous version didn't.
* Revert "; * src/image.c (gif_load): Fix compilation error on MS-Windows."Lars Ingebrigtsen2022-04-11
| | | | | | This reverts commit a715f2fbe70bb4cbb961e82af95e2965030b4513. This is fixed in a different way in a subsequent commit.
* ; * src/image.c (gif_load): Fix compilation error on MS-Windows.Eli Zaretskii2022-04-11
|
* Fix anim_cache garbage collectionLars Ingebrigtsen2022-04-11
| | | | | * src/image.c (struct anim_cache): Move earlier. (mark_image_cache): Mark the Lisp_Object in the anim cache.
* Fix compilation errors when HAVE_GIF and not HAVE_WEBPLars Ingebrigtsen2022-04-11
| | | | * src/image.c: Enable the cache functions when HAVE_GIF, too
* Speed up GIF animationsLars Ingebrigtsen2022-04-11
| | | | | | | | | | * src/image.c (anim_prune_animation_cache): Tweak the destructor API. (gif_destroy): New function. (gif_load): Use a cache to avoid quadratic CPU usage for animated images (bug#45224). (webp_destroy): New function. (webp_load): Use it.
* Refactor the webp cache code to allow usage by gif_load, tooLars Ingebrigtsen2022-04-11
| | | | | | | | * src/image.c (struct anim_cache, anim_create_cache) (anim_prune_animation_cache, anim_get_animation_cache): Rename from webp_cache (etc) to prepare for usage in the gif animation implementation, too. (webp_load): Adjust cache usage.
* Improve gif_load error messagesLars Ingebrigtsen2022-04-11
| | | | * src/image.c (gif_load): Improve error reporting (bug#54848).
* Fix WebP image support on MS-WindowsEli Zaretskii2022-04-10
| | | | | | | | | | | | | | | * src/image.c (init_webp_functions) [WINDOWSNT]: Load Demux functions from the WebPDemux DLL. Load internal functions where the public APIs are inline functions defined in the WebP headers. (WebPAnimDecoderOptionsInit) [WINDOWSNT]: Define to call 'WebPAnimDecoderOptionsInitInternal'. (WebPDemux): Define to call 'WebPDemuxInternal'. (WebPAnimDecoderNew): Define to call 'WebPAnimDecoderNewInternal'. (syms_of_image) <webpdemux>: New symbol. * lisp/term/w32-win.el (dynamic-library-alist): Add a member for 'webpdemux'.
* Add support for animated webp imagesLars Ingebrigtsen2022-04-10
| | | | | | | | | | | | | | * configure.ac (HAVE_RSVG): Also include the webpdemux library. It was new in version 0.4.4, and we require 0.6.0, so it should be safe. * src/image.c: Include demux.h. (enum webp_keyword_index, webp_format): Include :index for animations. (init_webp_functions): Add Windows LOAD_DLLs. (struct webp_cache, webp_create_cache) (webp_prune_animation_cache, webp_get_animation_cache): New functions. (webp_load): Support animated webp images (bug#54242).
* ; * src/image.c (syms_of_image): Fix whitespace.Eli Zaretskii2022-03-26
|
* Enable the native display of BMP images on HaikuPo Lu2022-03-26
| | | | | * src/image.c (syms_of_image): Also register `bmp' image type on Haiku when native image APIs are enabled.