aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * src/image.c: Fix building with giflib 4.YAMAMOTO Mitsuharu2021-11-031-9/+10
|
* Use primes for hash table bucket sizesStefan Kangas2021-10-301-2/+2
| | | | | | * src/dispextern.h (IMAGE_CACHE_BUCKETS_SIZE): * src/image.c (XPM_COLOR_CACHE_BUCKETS): Use primes for hash table bucket sizes.
* ; Fix a recent change in image.cEli Zaretskii2021-10-291-4/+8
| | | | * src/image.c (DGifSavedExtensionToGCB): Define only for GIFLIB >= 5.
* * src/image.c: Fix building with giflib on MS-Windows.Stefan Kangas2021-10-291-0/+7
|
* Prefer giflib 5 macros to magic numbersStefan Kangas2021-10-291-10/+16
| | | | | | | | * src/image.c (DISPOSAL_UNSPECIFIED, DISPOSE_DO_NOT) (DISPOSE_BACKGROUND, DISPOSE_PREVIOUS, NO_TRANSPARENT_COLOR) [GIFLIB_MAJOR < 5]: Macro defined (for old versions of giflib). (gif_load): Replace magic numbers with giflib 5 macros for disposal and transparency_color_index.
* Don't parse GCB block by hand with giflib 5 or laterStefan Kangas2021-10-291-4/+12
| | | | | | * src/image.c (gif_load): If GIFLIB_MAJOR > 5, use DGifSavedExtensionToGCB instead of parsing the Graphic Control Extension block by hand.
* * src/image.c (gif_load): Minor simplification.Stefan Kangas2021-10-291-20/+15
|
* * src/image.c (webp_load): Fix thinkos.Stefan Kangas2021-10-231-2/+2
|
* Fix WebP support on MS-WindowsEli Zaretskii2021-10-221-5/+11
| | | | | | | | | | | | | | | | * src/image.c (WebPDecodeRGBA, WebPDecodeRGB, WebPFree): Use correct names and argument lists in DEF_DLL_FN; fix typos. (WebPGetFeaturesInternal): Load this instead of WebPGetFeatures, which is a static inline function in webp/decode.h. (WebPGetFeatures): Redirect to call WebPGetFeaturesInternal. * lisp/term/w32-win.el (dynamic-library-alist): Fix the name of the WebP symbol. * configure.ac (HAVE_WEBP): Fix detection of libwebp on MinGW. * nt/INSTALL.W64: * nt/INSTALL: Update information about libwebp availability.
* Add WebP image format support (Bug#51296)Stefan Kangas2021-10-221-0/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac (--with-webp): New option. (HAVE_WEBP): New variable. (emacs_config_features): Add webp. * src/image.c (enum webp_keyword_index) [HAVE_WEBP]: New enum. (webp_format) [HAVE_WEBP]: New variable. (webp_image_p, init_webp_functions, webp_load) [HAVE_WEBP]: New functions for WebP support. (image_types) [HAVE_WEBP]: Define WebP format. (syms_of_image) <Qwebp> [HAVE_WEBP]: New DEFSYM. Add image type Qwebp. * src/Makefile.in (LIBIMAGE): Add WEBP_LIBS. * lisp/files.el (auto-mode-alist): * lisp/image-file.el (image-file-name-extensions): * lisp/image.el (image-type-header-regexps) (image-type-file-name-regexps, image-type-auto-detectable): Add WebP support. * lisp/term/w32-win.el (dynamic-library-alist): Add the libwebp DLL. * INSTALL: * admin/CPP-DEFINES: * doc/lispref/display.texi (Image Formats, Other Image Types): * nt/INSTALL: Document WebP support. * test/lisp/image-tests.el (image-find-image) (image-type-from-file-name): Expand tests. * test/src/image-tests.el (image-tests--files): Add WebP. (image-tests-image-size/webp, image-tests-image-mask-p/webp) (image-tests-image-metadata/webp): New tests. * test/data/image/black.webp: New file.
* Merge from origin/emacs-28Glenn Morris2021-10-181-9/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c163fd9260 (origin/emacs-28) Minor fixes for recent changes in ELisp ... fefada4816 Fix example in calc manual e74e17c1f0 Rewrites of Elisp manual including tab-bar and tab-line ch... 3b138917b7 ; * INSTALL: Fix typo. ce71446585 * lisp/tab-bar.el: Improve docstrings (bug#51247) ace4ce16a3 * lisp/tab-bar.el (tab-bar-mouse-move-tab): Don't drag tab... 04716ca48f Add tab-bar-drag-maybe for indication of tab dragging (bug... 81e3697600 * lisp/tab-bar.el: Add a new tab on [mouse-1] instead of [... a191d3c725 Add new and fix existing docstrings in tab-bar.el and tab-... 77dbaedadc Add tab bar support to the nextstep port 7b6fb486c2 Fix potential buffer overflow (bug#50767) ed9f5546aa Improve doc strings in tab-line.el 686a03ee22 More documentation fixes in tab-bar.el 35920791df Improve doc strings of tab-bar commands 2d15db6e89 Fix a semantic test on some macOS machines ac6ac76e3a Update to Org 9.5-57-g9bc3a2
| * Fix potential buffer overflow (bug#50767)Alan Third2021-10-171-9/+14
| | | | | | | | | | | | * src/image.c (svg_load_image): Check how many bytes were actually written to the buffer. Don't check xmalloc return value as xmalloc doesn't return if it fails.
* | * src/image.c: Fix comment.Stefan Kangas2021-10-171-3/+2
|/
* ; Fix typosStefan Kangas2021-09-031-2/+2
|
* Fix deprecation warnings from libtiffEli Zaretskii2021-07-141-4/+11
| | | | | | * src/image.c (UINT32) [TIFFLIB_VERSION >= 20210416]: Define to use stdint.h type for recent libtiff versions. Reported by Andy Moreton <andrewjmoreton@gmail.com>.
* Pacify GCC 11.1.1 20210531 (Red Hat 11.1.1-3)Paul Eggert2021-07-111-2/+2
| | | | | | * src/image.c (xpm_load_image): * src/xfns.c (x_icon): Rework to pacify gcc -Wmaybe-uninitialized.
* Fix image filename encoding issues (bug#48902)Alan Third2021-06-091-13/+10
| | | | | | | | | * src/image.c (image_find_image_fd): Don't return an encoded filename string. * src/nsfns.m: ([NSString stringWithLispString:]): Clarify usage comment. * src/nsimage.m ([EmacsImage allocInitFromFile:]): No need to encode the filename when converting to NSString.
* ; * src/image.c (xpm_format, xpm_valid_color_symbols_p): Fix last change.Eli Zaretskii2021-05-131-2/+3
|
* * src/image.c (xpm_image_p): Avoid another compiler warning.Eli Zaretskii2021-05-131-0/+2
|
* * src/image.c: Avoid compiler warnings in Cairo builds without XPM.Eli Zaretskii2021-05-131-3/+4
|
* Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-04-191-17/+41
|\
| * Fix :scale's affect on :width and :height (bug#47819)Alan Third2021-04-171-2/+2
| | | | | | | | | | * src/image.c (compute_image_size): Multiply width and height values by scale.
| * Allow use of em in image spec sizesAlan Third2021-04-151-17/+41
| | | | | | | | | | | | | | | | | | | | * src/image.c (image_get_dimension): New function. (compute_image_size): Use image_get_dimension to set the sizes, and pass in the image struct instead of just the spec. (image_set_transform): (imagemagick_load_image): (svg_load_image): Use the image instead of the spec in compute_image_size. (syms_of_image): Add 'em' as a symbol.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-04-051-23/+86
|\ \ | |/
| * Fix MS-Windows buildEli Zaretskii2021-04-041-1/+15
| | | | | | | | | | | | * src/image.c: (init_svg_functions) [WINDOWSNT]: Define and load rsvg_handle_set_stylesheet from the DLL for librsvg > 2.48. (lookup_image): Use xmalloc.
| * Fix warnings in image.cAlan Third2021-04-041-4/+7
| | | | | | | | | | * src/image.c (svg_load_image): Fix types and move declaration of 'css' to the top of the function.
| * Set CSS for SVG filesAlan Third2021-04-031-15/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/dispextern.h (struct image): Add font details required for the CSS. * src/image.c (free_image): Free the font family string. (search_image_cache): (uncache_image): Make image caching understand the font details. (lookup_image): Handle the font details when generating the image and looking up the cache. (svg_css_length_to_pixels): Handle 'em' when we know the font size. (svg_load_image): Generate the CSS and apply it to the SVG. (enum svg_keyword_index): (svg_format): (syms_of_image): Add ':css' attribute. * doc/lispref/display.texi (SVG Images): Add details of new svg image attributes.
| * Implement frame-scale-factorAlan Third2021-04-031-8/+0
| | | | | | | | | | | | | | * src/frame.c (Fframe_scale_factor): New function. (syms_of_frame): Add frame-scale-factor. * src/frame.h: Add FRAME_SCALE_FACTOR. * src/image.c: Move FRAME_SCALE_FACTOR to frame.h.
* | Merge remote-tracking branch 'savannah/master' into native-compAndrea Corallo2021-03-191-1/+2
|\ \ | |/
| * Fix buffer overflow in xbm_scan (bug#47094)Alan Third2021-03-131-1/+2
| | | | | | | | | | * src/image.c (xbm_scan): Ensure reading a string doesn't overflow the buffer.
* | Do not load native code when `load' is explicitly called on a .elc fileAndrea Corallo2021-03-191-2/+2
|/ | | | | | | | | | | | | | | | | | | * src/lread.c (Fload): Do not load native code when `load' is explicitly called on a .elc file. (Flocate_file_internal): Update 'openp' call sites. (maybe_swap_for_eln): Add new 'no_native' parameter. (openp): Likewise + update 'maybe_swap_for_eln' and 'openp' call sites. * src/lisp.h: Update 'openp' signature. * src/w32proc.c (sys_spawnve): Update 'openp' call sites. * src/w32.c (check_windows_init_file): Likewise. * src/sound.c (Fplay_sound_internal): Likewise. * src/process.c (Fmake_process): Likewise. * src/image.c (image_create_bitmap_from_file) (image_find_image_fd): Likewise. * src/emacs.c (set_invocation_vars): Likewise. * src/charset.c (load_charset_map_from_file): Likewise. * src/callproc.c (call_process): Likewise.
* * src/image.c (image_set_transform): Don't use ! for Lisp object.Philipp Stephani2021-03-111-1/+1
|
* * src/image.c (FRAME_SCALE_FACTOR): Define only when needed.Philipp Stephani2021-03-111-0/+2
|
* ; Fix US spelling in last change.Basil L. Contovounesios2021-03-101-1/+1
|
* Enable selectable image smoothing (bug#38394)Alan Third2021-03-101-5/+11
| | | | | | | | | | | | | | | * lisp/doc-view.el (doc-view-insert-image): Always use smoothing in docview. * lisp/image-mode.el (image-transform-smoothing): New variable. (image-mode-map): Add smoothing binding. (image-transform-properties): Apply smoothing when requested. (image-transform-set-smoothing): New function. (image-transform-reset): Reset smoothing. * src/image.c (image_set_transform): Use new :transform-smoothing attribute. (syms_of_image): Add :transform-smoothing attribute. * doc/lispref/display.texi (Image Descriptors): Document new :transform-smoothing property.
* Remove aliasing on SVG images under scaled NS framesAlan Third2021-02-131-2/+11
| | | | | | | | | * src/image.c (FRAME_SCALE_FACTOR): New #define for getting frame scale factor. (image_set_transform): (svg_load_image): Use FRAME_SCALE_FACTOR. * src/nsterm.m (ns_frame_scale_factor): Get the scale factor for an NS frame.
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Improvements for `:base-uri' svg image propertyZajcev Evgeny2020-12-261-3/+5
| | | | | | | * src/image.c (svg_load): Use ENCODE_FILE for `:base-uri' * doc/lispref/display.texi (SVG Images): Add more documentation for `:base-uri'
* Fix image cache lookupAlan Third2020-12-201-1/+1
| | | | | * src/image.c (lookup_image): ignore_colors should be false as we want to search for images with matching colors.
* image-cache-size improvementsMattias EngdegÄrd2020-12-201-17/+41
| | | | | | | | | | | | | Implement for non-Cairo X11 and NS. Count masks as well, and XImage objects on X11. * src/image.c (image_size_in_bytes): New. (image_frame_cache_size): Use image_size_in_bytes. * src/nsterm.h: * src/nsimage.m (ns_image_size_in_bytes, [EmacsImage sizeInBytes]): New function and method. * src/w32gui.h: * src/w32term.c (w32_image_size): Update signature.
* Merge from origin/emacs-27Glenn Morris2020-12-151-0/+9
|\ | | | | | | | | 62a6934af9 Fix crash when using XRender and restoring image from X (b... de032d41c6 Bind k to image-kill-buffer in doc-view-mode-map.
| * Fix crash when using XRender and restoring image from X (bug#44930)Alan Third2020-12-121-0/+9
| | | | | | | | | | | | | | * src/dispextern.h (struct image): Add original dimension elements. * src/image.c (image_set_transform): Store the original dimensions. (image_get_x_image): If we're using transforms use the original dimensions with XGetImage.
* | Fix assertion on SVG load failureAlan Third2020-12-121-5/+6
| | | | | | | | | | * src/image.c (svg_load_image): Move setting DPI to after rsvg_handle error checking.
* | Explicitly specify svg base_uri using `:base-uri' image propertyZajcev Evgeny2020-12-121-7/+14
| | | | | | | | | | | | | | | | | | * src/image.c (svg_load): Check `:base-uri' image property to explicitly set base_uri for images embedded into SVG (enum svg_keyword_index): (svg_format): Add :base-uri. * lisp/svg.el (svg-embed-base-uri-image): New function to embed images located relative to images `:base-uri'
* | Revert "Explicitly specify svg base_uri using `:base-uri' image property"Alan Third2020-12-121-12/+7
| | | | | | | | | | | | This reverts commit a8e2143a5c03785742464406306fda7fce6caf04. I applied the incorrect version of the patch.
* | Unbreak the MS-Windows build broken by recent changesEli Zaretskii2020-12-121-0/+6
| | | | | | | | | | | | * src/image.c (rsvg_handle_set_dpi_x_y) [WINDOWSNT]: DEF_DLL_FN it. (init_svg_functions): LOAD_DLL_FN rsvg_handle_set_dpi_x_y. <rsvg_handle_set_dpi_x_y>: Define as a macro
* | Improve support for 'memory-report' on MS-WindowsEli Zaretskii2020-12-121-4/+17
| | | | | | | | | | | | | | | | * src/w32term.c (w32_image_size): New function. * src/image.c (image_frame_cache_size) [HAVE_NTGUI]: Support reporting the size of frame image cache. (image_frame_cache_size, Fimage_cache_size): The total size is now of the type 'size_t', not 'int'.
* | Use real DPI when rendering SVGs (bug#45124)Alan Third2020-12-121-10/+21
| | | | | | | | | | | | | | * src/image.c (svg_css_length_to_pixels): Pass in a DPI value instead of using a hard coded value. (svg_load_image): Set the DPI on the rsvg_handle, and pass it to svg_css_length_to_pixels.
* | Explicitly specify svg base_uri using `:base-uri' image propertyZajcev Evgeny2020-12-121-7/+12
| | | | | | | | | | * src/image.c (svg_load): Check `:base-uri' image property to explicitly set base_uri for images embedded into SVG
* | Fix image-cache-size crashLars Ingebrigtsen2020-12-111-4/+4
| | | | | | | | | | * src/image.c (image_frame_cache_size): Ensure that img->pixmap is in use before trying to access it.