incorporate comments from @lovell review

This commit is contained in:
John Cupitt 2021-04-18 17:53:15 +01:00
parent b1abb2d824
commit 0cdfb851b9
3 changed files with 17 additions and 11 deletions

View File

@ -778,7 +778,7 @@ AC_ARG_WITH([libjxl],
if test x"$with_libjxl" != x"no"; then
PKG_CHECK_MODULES(LIBJXL, libjxl_threads >= 0.3.7 libjxl >= 0.3.7,
[AC_DEFINE(HAVE_LIBJXL,1,
[define if you have libjxl >=2.2 installed.])
[define if you have libjxl >= 0.3.7 installed.])
with_libjxl=yes
PACKAGES_USED="$PACKAGES_USED libjxl"
],

View File

@ -33,8 +33,8 @@
/*
#define DEBUG_VERBOSE
*/
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -359,11 +359,11 @@ vips_foreign_load_jxl_process( VipsForeignLoadJxl *jxl )
while( (status = JxlDecoderProcessInput( jxl->decoder )) ==
JXL_DEC_NEED_MORE_INPUT ) {
size_t unused;
size_t bytes_remaining;
unused = JxlDecoderReleaseInput( jxl->decoder );
if( vips_foreign_load_jxl_fill_input( jxl, unused ) &&
unused == 0 )
bytes_remaining = JxlDecoderReleaseInput( jxl->decoder );
if( vips_foreign_load_jxl_fill_input( jxl, bytes_remaining ) &&
bytes_remaining == 0 )
return( JXL_DEC_ERROR );
JxlDecoderSetInput( jxl->decoder,
jxl->input_buffer, jxl->bytes_in_buffer );
@ -897,6 +897,9 @@ vips_foreign_load_jxl_source_init(
*
* Read a JPEG-XL image.
*
* The JPEG-XL loader and saver are experimental features and may change
* in future libvips versions.
*
* See also: vips_image_new_from_file().
*
* Returns: 0 on success, -1 on error.
@ -921,7 +924,7 @@ vips_jxlload( const char *filename, VipsImage **out, ... )
* @out: (out): image to write
* @...: %NULL-terminated list of optional named arguments
*
* Exactly as vips_jxlload(), but read from a source.
* Exactly as vips_jxlload(), but read from a buffer.
*
* Returns: 0 on success, -1 on error.
*/

View File

@ -1,4 +1,4 @@
/* save as jpeg2000
/* save as jpeg-xl
*
* 18/3/20
* - from heifload.c
@ -33,8 +33,8 @@
/*
#define DEBUG_VERBOSE
*/
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -676,6 +676,9 @@ vips_foreign_save_jxl_target_init( VipsForeignSaveJxlTarget *target )
*
* Write a VIPS image to a file in JPEG-XL format.
*
* The JPEG-XL loader and saver are experimental features and may change
* in future libvips versions.
*
* @tier sets the overall decode speed the encoder will target. Minimum is 0
* (highest quality), and maximum is 4 (lowest quality). Default is 0.
*
@ -683,8 +686,8 @@ vips_foreign_save_jxl_target_init( VipsForeignSaveJxlTarget *target )
* (highest quality), and maximum is 15 (lowest quality). Default is 1.0
* (visually lossless).
*
* As a convenience, you can use @Q to set @distance. @Q of 75 is distance
* 1.0, @Q of 100 is distance 0.0.
* As a convenience, you can also use @Q to set @distance. @Q uses
* approximately the same scale as regular JPEG.
*
* Set @lossless to enable lossless compresion.
*