summaryrefslogtreecommitdiff
path: root/src/image.c
AgeCommit message (Collapse)Author
2026-05-27Port MinGW GCC 9.2 image.c fix to non MS-WindowsPaul Eggert
Avoid useless casts on GCC 14+ platforms on non MS-Windows, by using a cast only if HAVE_NTGUI. That cast should not provoke -Wuseless-cast regardless of how MS-Windows defines HDC, since it casts to an Emacs-defined type. This change lets the code compile again on Fedora 44 with --enable-gcc-warnings. * src/dispextern.h (PIX_CONTAINER_TO_CONTEXT): New macro. It defaults to the identity macro. (Emacs_Pix_Context): Default to Emacs_Pix_Container. * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load, gif_load, svg_load_image): Use the new macro instead of a cast.
2026-05-27Unbreak MS-Windows build broken by Gnulib syncEli Zaretskii
* src/conf_post.h: Add leading underscores to 'gl_consolesafe_*' functions, to follow Gnulib's renaming. * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load): Revert previous change that removed "useless" casts, as removing them triggers warnings from MinGW GCC 9.2.
2026-05-26ARRAYELTS → countofPaul Eggert
C2y will standardize countof as the macro that Emacs uses the name ARRAYELTS for. Switch to the standard name, which is supported by GCC 16+, by Clang 21, and by the Gnulib stdcountof-h module already in use for compilers that do not support countof. Also, use countof in a few places where we missed using ARRAYELTS. * admin/coccinelle/arrayelts.cocci: Suggest countof, not ARRAYELTS. * admin/merge-gnulib (GNULIB_MODULES): Add stdcountof-h, as it is now a direct rather than an indirect dependency. * exec/trace.c, src/lisp.h, src/sfnt.c: Include <stdcountof.h>. (ARRAYELTS): Remove. All uses replaced by countof. * lib-src/ebrowse.c, lib-src/etags.c, lib-src/make-docfile.c: * lib-src/seccomp-filter.c, lwlib/lwlib-Xaw.c: Prefer <stdcountof.h> and countof to doing things by hand.
2026-05-26Omit useless casts found by GCC 16Paul Eggert
GCC 16’s -Wuseless-cast warning can be useful. Fix the useless casts it identifies, and also fix false positives by using compound literals, which are safer anyway than casts. * src/composite.c (composition_adjust_point) (Ffind_composition_internal): * lwlib/xlwmenu.c (xlwMenuResources, xlwMenuClassRec) (resource_widget_value, XlwMenuDestroy, Select): * src/alloc.c (process_mark_stack): * src/data.c (Faref): * src/emacs-module.c (module_extract_big_integer): * src/fileio.c (Finsert_file_contents): * src/frame.h (FRAME_MESSAGE_BUF_SIZE): * src/gtkutil.c (xg_tool_item_stale_p, update_frame_tool_bar): * src/image.c (pbm_load, png_load_body, jpeg_load_body) (tiff_load, gif_load): * src/pdumper.c (ptrdiff_t_to_dump_off, dump_queue_dequeue) (field_relpos, dump_field_emacs_ptr) (dump_object_start_pseudovector, pdumper_remember_scalar_impl) (pdumper_load, syms_of_pdumper): * src/regex-emacs.c (BUF_PUSH, BUF_PUSH_2, POINTER_TO_OFFSET): * src/xdisp.c (remember_mouse_glyph, pint2str): * src/xterm.c (cvt_string_to_pixel, handle_one_xevent): Omit useless casts. Perhaps they were formerly needed, but they should not be needed now. * src/alloc.c (Fmemory_info): * src/category.c (Fdefine_category, Fmodify_category_entry): * src/data.c (Fash): * src/dispextern.h (GLYPH_CODE_P): * src/emacs.c (load_seccomp): * src/fns.c (Flocale_info, maybe_resize_hash_table): * src/indent.c (check_display_width): * src/json.c (symset_size): * src/lisp.h (XUNTAG, BOOL_VECTOR_LENGTH_MAX, obarray_size) (hash_table_index_size): * src/lread.c (make_obarray, grow_obarray, Fobarray_clear): * src/menu.c (digest_single_submenu, x_popup_menu_1): * src/term.c (init_tty): * src/widget.c (update_wm_hints): * src/xdisp.c (truncate_echo_area): * src/xfns.c (x_set_border_pixel): * src/xfont.c (xfont_match, xfont_open): * src/xmenu.c (set_frame_menubar): * test/src/emacs-module-resources/mod-test.c (emacs_module_init): Use compound literal instead of a cast that is useless in some platforms but not others. * src/dispextern.h, src/haikugui.h, src/w32gui.h: (WINDOW_HANDLE_UINTPTR): New macro. * src/frame.c (gui_report_frame_params): * src/xterm.c (x_try_cr_xlib_drawable): Use it. * src/lisp.h (XUNTAG): And tag with UINTPTR_MAX to pacify gcc warning about a constant out of range. (hash_idx_t): Make it int_least32_t, as it need not be exactly 32 bits. (PRIdHASH_IDX): New macro. * src/pdumper.c (dump_queue_dequeue): Use it. * src/profiler.c (setup_cpu_timer): Make a local EMACS_INT rather than int, to avoid need for casting later. * src/syntax.c (uninitialized_interval): Use 1u rather than 1 so the cast is always useful. A compound literal wouldn’t do here, as this macro needs to be an integer constant expression. * src/xfns.c (XICCallback, XICProc): Remove macros. (Xxic_preedit_start_callback): Use a cleaner way to specify it, avoiding the need for type macros, and for a cast if HAVE_XICCALLBACK_CALLBACK. * src/xterm.c (handle_one_xevent): 2nd arg is now XEvent * on all platforms, as there is no need to diverge, and diverging meant we needed lots of unnecessary casts.
2026-05-23Prefer ptrdiff_t to size_t when either will doPaul Eggert
Signed types are a bit safer, as they avoid some comparison confusion and -fsanitize=undefined can check more misuses of them. * src/alloc.c (lisp_malloc, lisp_align_malloc) (allocate_string_data, allocate_vector_from_block, object_bytes): * src/coding.c (from_unicode_buffer): * src/decompress.c (acc_size, accumulate_and_process_md5): * src/emacs.c (load_seccomp, shut_down_emacs): * src/fns.c (sxhash_bignum): * src/ftfont.c (get_adstyle_property): * src/image.c (lookup_image, xpm_init_color_cache) (xpm_cache_color): * src/json.c (json_out_str, struct json_parser) (json_make_object_workspace_for_slow_path) (json_make_object_workspace_for, json_parse_array) (json_parse_object): * src/sysdep.c (get_current_dir_name_or_unreachable) (init_sys_modes, convert_speed): * src/termchar.h (struct tty_display_info): * src/textconv.h (struct textconv_conversion_text): * src/xfns.c (struct x_xim_text_conversion_data) (x_encode_xim_text): * src/xselect.c (struct transfer, c_size_for_format) (x_size_for_format, selection_data_for_offset) (selection_data_size, x_start_selection_transfer) (x_continue_selection_transfer): Prefer ptrdiff_t to size_t when either will do. * src/term.c (Ftty__set_output_buffer_size): Limit output buffer size to PTRDIFF_MAX as well as to SIZE_MAX.
2026-05-23New function memory_full_upPaul Eggert
* src/alloc.c (memory_full_up): New function. Replace all callers of memory_full (SIZE_MAX) with callers to this function. This simplifies callers and should make future changes easier. It also saves a whopping 296 bytes in executable size with gcc 16.1.1 20260515 (Red Hat 16.1.1-2) x86-64.
2026-03-04Fix seg fault when image dimensions don't match (bug#80518)Alan Third
* src/image.c (four_corners_best): [USE_CAIRO] Reset the image dimensions to real values. (Fimage_transforms_p): Fix typo.
2026-02-21Fix SVG CSS handling (bug#80384)Alan Third
This reverts commit 9f5d17cd7219f72066488c6c57f77e4db9ca2563, but includes the fix for adding user CSS after the generated CSS. * src/image.c (svg_load_image): Set the CSS stylesheet using the librsvg functions, instead of inserting it into the wrapper.
2026-02-17; Fix image_error argument in webp_load.Basil L. Contovounesios
2026-01-28Always unset lisp_data when freeing imagesBasil L. Contovounesios
Historically only the GIF code did this (since it stores animation metadata in lisp_data), and recently the WebP code followed suit. The benefit of clearing lisp_data is not 100% clear (to me: bug#66221#41), but it probably can't hurt, so do it unconditionally for all image types to simplify conditional compilation and avoid warnings (bug#80266). * src/image.c (image_clear_image): Set lisp_data to nil. [HAVE_GIF || HAVE_WEBP] (gif_clear_image): [HAVE_IMAGEMAGICK] (imagemagick_clear_image): Remove, replacing all uses with image_clear_image.
2026-01-27; Avoid warnings when neither GIF nor WebP are supportedPo Lu
* src/image.c (gif_clear_image): Render contingent on HAVE_GIF || HAVE_WEBP.
2026-01-26Fix image.c compilation when HAVE_GIF is not definedEli Zaretskii
* src/image.c (gif_clear_image): Make it available for other image types. (Bug#80266)
2026-01-24Improve (WebP) image animationBasil L. Contovounesios
This adds support for animations with heterogeneous frame durations without sacrificing CPU (bug#47895), and plugs a memory leak in and speeds up WebP animations (bug#66221). * lisp/image.el (image-animate): No need to stash image-multi-frame-p data here, as image-animate-timeout now refetches it for each animation frame. (image-show-frame): Fetch image-multi-frame-p anew when checking bounds; a cached value risks going stale. This is not on the hot path for animations, and is mainly used when framewise stepping through an animation interactively. (image-animate-timeout): Fetch current frame duration anew but do so before image-show-frame to ensure an image cache hit (bug#47895, bug#66221). Include time taken by local arithmetic in 'time-to-load-image'. Update commentary. * src/image.c (parse_image_spec): Simplify using FIXNATP. (filter_image_spec): Remove check for :animate-multi-frame-data as it is no longer used by image.el. [HAVE_ANIMATION && HAVE_GIF] (struct gif_anim_handle): [HAVE_ANIMATION && HAVE_WEBP] (struct webp_anim_handle): New structures formalizing animation cache handles, and allowing for more than two custom fields per image type. (struct anim_cache): Replace generic handle and temp pointers with a union of gif_anim_handle and webp_anim_handle. All uses updated. Update destructor signature accordingly. (anim_create_cache): Use xzalloc to zero-initialize both integer and pointer fields. Initialize frames, width, height to -1 for consistency with index. Mark as ATTRIBUTE_MALLOC. (anim_prune_animation_cache): Check whether destructor (not handle) is null before calling it. (gif_clear_image): Note in commentary that WebP also uses it. (gif_destroy): Free pixmap here now that prune_anim_cache no longer does it automatically. Remove unused gif_err variable. (gif_load): Avoid UB from casting destructor to a different type. Don't redundantly check for null before xfree. Change default frame delay from 15fps to t, which image-multi-frame-p will translate into image-default-frame-delay, which the user can control. [HAVE_WEBP && WINDOWSNT] (init_webp_functions): Reconcile library definitions with current webp_load implementation. (webp_destroy): Free owned copy of input WebP bitstream contents. (webp_load): Ownership of both input and decoded memory is a function of :data vs :file and animated vs still. Make this and transfers of ownership to animation cache clearer by using distinct copy/view variables. Also make resource freeing clearer by using a single unconditional cleanup and exit path. Check animation cache early to avoid rereading bitstream and reparsing headers on each call. Remove redundant call to WebPGetInfo since WebPGetFeatures does the same thing. Check more libwebpdemux return values for failure and fix file name reported in error messages. Remove unset local variable 'file'. If requested :index is ahead, fast-forward instead of restarting from first frame. If requested :index is behind, reset animation decoder to first frame instead of deleting and recreating it. Reuse animation decoder's own WebPAnimInfo and WebPDemuxer instance instead of creating and deleting a separate WebPDemuxer. Fix leak when copying :data to animation cache. Fix frame duration calculation, and return each frame's own duration now that image.el supports it. Return t as a default frame duration, as per gif_load. Consistently use WebPBitstreamFeatures to simplify control flow. Don't pollute lisp_data image-metadata for still images with animation-related properties. (image_types) [HAVE_WEBP]: Use gif_clear_image to clear lisp_data for consistency with GIF code. (syms_of_image): Remove QCanimate_multi_frame_data; no longer used.
2026-01-24Improve animation cache documentationBasil L. Contovounesios
* doc/lispref/display.texi (Image Cache): Document animation cache argument that clear-image-cache gained in Emacs 29 (bug#56546, bug#66221). * lisp/image.el (image-animate-timeout): Note limitation of clear-image-cache with ImageMagick. * src/image.c (Fclear_image_cache): Rename animation-cache argument to animation-filter and expand its description for clarity. (struct anim_cache, anim_create_cache, image_prune_animation_caches): Improve commentary. (mark_image_cache): Replace stale commentary that referred to forall_images_in_image_cache with description of mark_image_cache. [HAVE_IMAGEMAGICK] (struct animation_cache): Mention lack of clear-image-cache support in commentary.
2026-01-17Avoid overflows in image size calculationsPaul Eggert
Problem reported by Basil L. Contovounesios (bug#66221#89). * src/image.c (image_size_in_bytes, image_frame_cache_size): Use intptr_t for sizes of collections of objects. (struct anim_cache.byte_size, gif_load, Fimage_cache_size): Use intmax_t for sizes of either files or objects.
2026-01-17NS: Add native image support for HEIF, SVG and WEBP on GNUstepYavor Doganov
* src/nsimage.m (ns_can_use_native_image_api): Handle HEIF, SVG and WEBP image types on GNUstep. * src/image.c (syms_of_image): Add conditional native image support for HEIF, SVG and WEBP on GNUstep. (Bug#80101)
2026-01-16Various housekeeping in image.cBasil L. Contovounesios
* doc/lispref/display.texi (Customizing Bitmaps): Fix grammar. (XBM Images): Fix reference to incorrect number of properties. (Multi-Frame Images, Other Image Types): Mention multi-frame WebP support. * src/image.c: Don't include pdumper.h; it hasn't been needed since commit of 2019-05-17 "Clean up and simplify image-type setup". Fix some commentary. (image_pix_container_create_from_bitmap_data): Remove no longer used frame parameter (bug#80191); this continues from commit of 2022-11-25 "Remove unused parameter from image_create_pix_container". All callers updated. (x_create_xrender_picture, initialize_image_type): Simplify. (xbm_image_p): Remove redundant conditional branch. Update commentary.
2026-01-16Fix off-by-one error in native_image_pBasil L. Contovounesios
* src/image.c (native_image_format): Make array size explicit, to help keep it consistent with its later fmt descriptor copy. (native_image_p): Parse the correct number of keywords (bug#80191).
2026-01-01; Add 2026 to copyright years.Sean Whitton
2025-07-10Move CSS into the SVG wrapperAlan Third
This allows CSS to be used with librsvg < 2.48. * src/image.c (svg_load_image): Move CSS construction and include "color". Also append the CSS passed in by the user rather than replacing it.
2025-07-10Change foreground color handling for SVG files (bug#77841)Alan Third
* etc/images/checkbox-mixed.svg: * etc/images/checked.svg: * etc/images/conceal.svg: * etc/images/down.svg: * etc/images/gnus/gnus-pointer.svg: * etc/images/left.svg: * etc/images/outline-close.svg: * etc/images/outline-open.svg: * etc/images/radio-checked.svg: * etc/images/radio-mixed.svg: * etc/images/radio.svg: * etc/images/reveal.svg: * etc/images/right.svg: * etc/images/symbols/check-mark_16.svg: * etc/images/symbols/chevron_down_16.svg: * etc/images/symbols/chevron_left_16.svg: * etc/images/symbols/chevron_right_16.svg: * etc/images/symbols/chevron_up_16.svg: * etc/images/symbols/cross_16.svg: * etc/images/symbols/cross_circle_16.svg: * etc/images/symbols/cross_circle_fill_16.svg: * etc/images/symbols/dot_large_16.svg: * etc/images/symbols/dot_medium_16.svg: * etc/images/symbols/dot_small_16.svg: * etc/images/symbols/heart_16.svg: * etc/images/symbols/heart_fill_16.svg: * etc/images/symbols/heart_half_16.svg: * etc/images/symbols/menu_16.svg: * etc/images/symbols/minus_16.svg: * etc/images/symbols/minus_circle_16.svg: * etc/images/symbols/minus_circle_fill_16.svg: * etc/images/symbols/plus_16.svg: * etc/images/symbols/plus_circle_16.svg: * etc/images/symbols/plus_circle_fill_16.svg: * etc/images/symbols/star_16.svg: * etc/images/symbols/star_fill_16.svg: * etc/images/symbols/star_half_16.svg: * etc/images/unchecked.svg: * etc/images/up.svg: Set 'fill' color to 'currentcolor'. * etc/images/symbols/README: Add explanation of change to instructions. * src/image.c: Remove setting of the 'fill' color in the default SVG stylesheet.
2025-04-19Avoid name clashes with static GnuTLSPaul Eggert
Work around a bug in GnuTLS 3.7.11 and earlier: when built statically, its mistakenly exports symbols hash_lookup and hash_string, which collide with Emacs symbols of the same name, preventing temacs from linking statically. Problem reported by Greg A. Woods (Bug#77476). Because GnuTLS never uses hash_lookup or hash_string this issue ordinarily doesn’t seem to prevent temacs from linking to GnuTLS on GNU/Linux, as it’s linked dynamically and the dynamic linker never needs to resolve references to either symbol. However, I suppose a clash or bug could occur even with dynamic linking if Emacs later loads a module that uses either symbol. Although GnuTLS should be fixed, Emacs should link statically to current and older GnuTLS versions in the meantime, and it should avoid potential problems with dynamic linking. Renaming the two clashing names is an easy way to do this. For consistency with the new name for hash_lookup, also rename hash_lookup_with_hash and hash_lookup_get_hash. * src/fns.c (hash_find_with_hash): Rename from hash_lookup_with_hash. (hash_find): Rename from hash_lookup. (hash_find_get_hash): Rename from hash_lookup_get_hash. (hash_char_array): Rename from hash_string. All uses changed.
2025-03-06Avoid defining unneeded variables on Cygw32Kazuhiro Ito
lisp/term/w32-win.el contained definitions of variables which were not used on Cygw32. It is now to split into two files, common part and Windows native build specific part. The latter is a new file, lisp/term/w32-nt.el. * src/image.c (Qlibpng_version, Qlibgif_version) (Qlibjpeg_version): Don't define on Cygw32 build. * src/treesit.c (Qtree_sitter__library_abi): Ditto. * lisp/term/w32-win.el (dynamic-library-alist, libpng-version) (libgif-version, libjpeg-version, libgnutls-version) (tree-sitter--library-abi, gui-backend-set-selection) (gui-backend-get-selection, gui-backend-selection-owner-p) (gui-selection-exists-p): Moved to lisp/term/w32-nt.el. * lisp/term/w32-nt.el: New file, separated Windows native build specific part from lisp/term/w32-win.el. * lisp/loadup.el: Load term/w32-nt.el on Windows native build. (Bug#75926)
2025-02-22; Fix typosStefan Kangas
2025-02-01Merge branch 'scratch/no-purespace' into 'master'Stefan Kangas
2025-01-26Prefer make_formatted_string in svg_load_imagePaul Eggert
* src/image.c (svg_load_image): Prefer make_formatted_string to snprintf, as this simplifies the code and does not truncate the resulting string arbitrarily.
2025-01-26Simplify building of color names in image.cPaul Eggert
* src/image.c (make_color_name): New function. (image_background, image_build_heuristic_mask, png_load_body): Use it.
2025-01-26Simplify make_formatted_string APIPaul Eggert
From a suggestion by Pip Cet. * src/alloc.c (make_formatted_string): Omit first argument, to simplify the calling convention. All callers changed. * src/doprnt.c (doprnt): Also support %u. Update doc.
2025-01-22Minor image_error related cleanupsStefan Kangas
* src/image.c (image_create_x_image_and_pixmap_1): Avoid temporary variable by passing the value directly to image_error. (tiff_handler): Prefer image_error to add_to_log for local consistency.
2025-01-21When debugging image.c, abort if silent truncationPaul Eggert
* src/image.c (image_build_heuristic_mask, png_load_body): Abort if snprintf truncated. (If truncation is not possible here we should use sprintf instead, as that simplifies automatic runtime checking.)
2025-01-22Prefer snprintf to sprintf in image.cStefan Kangas
* src/image.c (image_background, image_build_heuristic_mask) (png_load_body): Prefer snprintf to sprintf.
2025-01-21Handle unknown units provided by the rsvg library (bug#75712)Pip Cet
* src/image.c (svg_css_length_to_pixels): Restructure so GCC warns about new enum members. Add case for RSVG_UNIT_CH. Warn about unknown units discovered at runtime.
2025-01-19Replace call[1-8] with callnStefan Kangas
Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>. * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
2025-01-18Always define image_compute_scalePaul Eggert
* src/image.c (image_compute_scale): Define even if ! (defined HAVE_IMAGEMAGICK || defined HAVE_NATIVE_TRANSFORMS), because it is always used. Needed in platforms that lack all those image libraries.
2025-01-01Update copyright year to 2025Paul Eggert
Run "TZ=UTC0 admin/update-copyright".
2024-12-28Make image cache aware of image-scaling-factor (bug#74725)Alan Third
* src/dispextern.h (struct image): Add scale so it can be compared in search_image_cache. * src/image.c (search_image_cache): Calculate the scale factor and compare with the cached value. (image_compute_scale): Compute the image's scale factor and optionally store it in the image struct. (compute_image_size): Move scale calculation code into image_compute_scale and use it.
2024-12-12Pure storage removal: Remove purecopy hash table flagPip Cet
* lisp/emacs-liqsp/comp.el (comp--jump-table-optimizable): Adjust comment. * src/category.c (hash_get_category_set): * src/emacs-module.c (syms_of_module): * src/fns.c (make_hash_table): Remove 'purecopy' flag and update docstring. (Fmake_hash_table): Ignore ':purecopy' argument. * src/frame.c (make_frame): * src/image.c (xpm_make_color_table_h): * src/lisp.h (struct Lisp_Hash_Table): Drop 'purecopy' flag. * src/pdumper.c (dump_hash_table): Don't dump 'purecopy' flag. * src/print.c (print_object): Don't print 'purecopy' flag * src/json.c (json_parse_object): * src/lread.c (readevalloop, read_internal_start): * src/pgtkterm.c (syms_of_pgtkterm): * src/profiler.c (export_log): * src/xfaces.c (syms_of_xfaces): * src/xterm.c (syms_of_xterm): Adjust calls to 'make_hash_table'.
2024-12-07Merge from origin/emacs-30Eli Zaretskii
f65de1019dc Fix the version of librsvg API change 43c4a06ffcc ; Fix grammar in Emacs user manual 6bca138d60e Fix latest test for dabbrev-expand
2024-12-02Fix the version of librsvg API changeManuel Giraud
* src/image.c (init_svg_functions, svg_load_image): The first official version that introduces 'rsvg_handle_get_pixbuf_and_error' is 2.59.0 not 2.58.0. (Bug#74606)
2024-12-02Do not use libjpeg quantization (bug#74476)Manuel Giraud
* src/image.c (jpeg_load_body): Remove libjpeg quantization.
2024-12-01Merge from emacs-30Yuan Fu
cf4f1387a65 ; Update tree-sitter manual 3c7687c1dd1 Allow passing nil to treesit-node-match-p (bug#74612) 748b19e56e8 Update to version 2.58 of librsvg API (bug#74606) 4c67f636c08 Fix decoding of non-ASCII email attachments bd8a6f70fb9 Prevent "Selecting deleted buffer" error with dabbrev-expand 0a753603a53 ; (dictionary-search-interface): Fix bug#74511.
2024-12-01Update to version 2.58 of librsvg API (bug#74606)Manuel Giraud
* src/image.c (init_svg_functions): Declare new function. (svg_load_image): Use it.
2024-11-05Support :transform-smoothing on images (MS-Windows) (bug#57166)Cecilio Pardo
* src/dispextern.h (struct image): Add field 'smoothing' for NTGUI. * src/image.c (image_set_transform): Assign the 'smoothing' field of the image struct. * src/w32gdiplus.h: Add references to more GDI+ functions. * src/w32image.c (gdiplus_init): Add references to more GDI+ functions. * src/w32term.c (w32_draw_image_foreground): If the image is marked for smoothing and GDI+ is available, draw it with GDI+ bilinear interpolation. * etc/NEWS: New entry for this change.
2024-09-01Explicitly include stdlib.h in src/image.c (Bug#72929)Pip Cet
* src/image.c: Add include.
2024-09-01Fix integer overflow when reading XPMStefan Kangas
* src/image.c (xpm_str_to_int): New function. (xpm_load_image): Replace sscanf with strtol, to correctly handle integer overflow when reading a malformed XPM file. (Bug#72245)
2024-08-16Don’t ignore -Wclobbered in image.cPaul Eggert
This fix is also prompted by Emacs bug#71744. * src/image.c: Do not ignore -Wclobbered. (png_load_body): Fix violations of the C standard, where setjmp clobbered c. Move mask_img decl to pacify GCC. (jpeg_load_body): Don’t make fp volatile; solve that problem in a better way, via a new fp_volatile local. Fix violations of the C standard, where setjmp clobbered mgr, img, and ximg. If __GNUC__ && !__clang__, add useless assignments to pacify GCC.
2024-07-27Merge from origin/emacs-30Eli Zaretskii
88e1ec22f27 Update to Org 9.7.9 1ae2f004473 Fix edge-case with 'which-key-dont-use-unicode' setter 68a5f1f7d18 NS: prevent makeKeyWindow warnings (bug#69525) 59a895ec499 ; * .gitignore: Add lisp/eshell/esh-groups.el. 5c08cd4e7c3 ; * doc/emacs/cmdargs.texi (Initial Options): Fix last ch... 309d0a71864 Add PROBLEMS entry for bug#72303 87389f9ff90 ; Improve documentation of 'line-prefix' and 'wrap-prefix'. 268a2d10fc9 Improve documentation of '--init-directory' command-line ... c27055a938a ; cperl-mode.el: Fix fontification of flip-flop (Bug#72296) fcd4e4c895d ; * admin/MAINTAINERS: Add myself for maintaining some ar... fdc133e97f6 Fix bug in server.el introduced by 0d7d835902df af527051cd3 ; * admin/MAINTAINERS: Remove Nicolas Petton. 7170282a59a lisp/minibuffer.el (completion--sifn-requote): Fix bug#72176 68906f184cb * admin/notes/spelling: Update note. 9eea6be5abf Don't produce invalid XML with multi-line commenting style b97786d9f6e ; * etc/NEWS: Entry for 'gnus-summary-limit-to-age' (bug#... a7996615663 Standardize possessive apostrophe usage in manuals, docs,... 67faaead754 Don't refer to obsolete finder group "wp" # Conflicts: # etc/NEWS
2024-07-25Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas
See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
2024-07-24Merge from savannah/emacs-30Andrea Corallo
976416bebe2 Fix some function type declaration 23549d71751 * src/image.c (gui_put_x_image): Avoid memory leak. cb633820c15 ; * doc/misc/use-package.texi (Getting Started): Fix word...
2024-07-24* src/image.c (gui_put_x_image): Avoid memory leak.Po Lu