Merge remote-tracking branch 'origin/7.38'
This commit is contained in:
commit
fa2305e8d3
@ -7,6 +7,7 @@
|
|||||||
- foreign memory buffer images did not have the right dhint, broke
|
- foreign memory buffer images did not have the right dhint, broke
|
||||||
command-line falsecolour on sequential images
|
command-line falsecolour on sequential images
|
||||||
- support many Radiance readers active at once
|
- support many Radiance readers active at once
|
||||||
|
- add secret "rgbjpeg" flag to vips_tiffsave() to help IIP
|
||||||
|
|
||||||
19/1/14 started 7.38.1
|
19/1/14 started 7.38.1
|
||||||
- bump soname, thanks benjamin
|
- bump soname, thanks benjamin
|
||||||
|
@ -47,7 +47,8 @@ int vips__tiff_write( VipsImage *in, const char *filename,
|
|||||||
gboolean pyramid,
|
gboolean pyramid,
|
||||||
gboolean squash,
|
gboolean squash,
|
||||||
VipsForeignTiffResunit resunit, double xres, double yres,
|
VipsForeignTiffResunit resunit, double xres, double yres,
|
||||||
gboolean bigtiff );
|
gboolean bigtiff,
|
||||||
|
gboolean rgbjpeg );
|
||||||
|
|
||||||
int vips__tiff_read( const char *filename, VipsImage *out, int page,
|
int vips__tiff_read( const char *filename, VipsImage *out, int page,
|
||||||
gboolean readbehind );
|
gboolean readbehind );
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* - wrap a class around the tiff writer
|
* - wrap a class around the tiff writer
|
||||||
* 17/3/12
|
* 17/3/12
|
||||||
* - argh xres/yres macro was wrong
|
* - argh xres/yres macro was wrong
|
||||||
|
* 26/1/14
|
||||||
|
* - add rgbjpeg flag
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -75,6 +77,7 @@ typedef struct _VipsForeignSaveTiff {
|
|||||||
double xres;
|
double xres;
|
||||||
double yres;
|
double yres;
|
||||||
gboolean bigtiff;
|
gboolean bigtiff;
|
||||||
|
gboolean rgbjpeg;
|
||||||
} VipsForeignSaveTiff;
|
} VipsForeignSaveTiff;
|
||||||
|
|
||||||
typedef VipsForeignSaveClass VipsForeignSaveTiffClass;
|
typedef VipsForeignSaveClass VipsForeignSaveTiffClass;
|
||||||
@ -123,7 +126,8 @@ vips_foreign_save_tiff_build( VipsObject *object )
|
|||||||
tiff->pyramid,
|
tiff->pyramid,
|
||||||
tiff->squash,
|
tiff->squash,
|
||||||
tiff->resunit, tiff->xres, tiff->yres,
|
tiff->resunit, tiff->xres, tiff->yres,
|
||||||
tiff->bigtiff ) )
|
tiff->bigtiff,
|
||||||
|
tiff->rgbjpeg ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
@ -249,6 +253,13 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class )
|
|||||||
VIPS_ARGUMENT_OPTIONAL_INPUT,
|
VIPS_ARGUMENT_OPTIONAL_INPUT,
|
||||||
G_STRUCT_OFFSET( VipsForeignSaveTiff, bigtiff ),
|
G_STRUCT_OFFSET( VipsForeignSaveTiff, bigtiff ),
|
||||||
FALSE );
|
FALSE );
|
||||||
|
|
||||||
|
VIPS_ARG_BOOL( class, "rgbjpeg", 20,
|
||||||
|
_( "RGB JPEG" ),
|
||||||
|
_( "Output RGB JPEG rather than YCbCr" ),
|
||||||
|
VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED,
|
||||||
|
G_STRUCT_OFFSET( VipsForeignSaveTiff, rgbjpeg ),
|
||||||
|
FALSE );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -136,6 +136,8 @@
|
|||||||
* 24/9/13
|
* 24/9/13
|
||||||
* - support many more vips formats, eg. complex, 32-bit int, any number
|
* - support many more vips formats, eg. complex, 32-bit int, any number
|
||||||
* of bands, etc., see the tiff loader
|
* of bands, etc., see the tiff loader
|
||||||
|
* 26/1/14
|
||||||
|
* - add RGB as well as YCbCr write
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -261,6 +263,7 @@ typedef struct tiff_write {
|
|||||||
float yres; /* Resolution in Y */
|
float yres; /* Resolution in Y */
|
||||||
char *icc_profile; /* Profile to embed */
|
char *icc_profile; /* Profile to embed */
|
||||||
int bigtiff; /* True for bigtiff write */
|
int bigtiff; /* True for bigtiff write */
|
||||||
|
int rgbjpeg; /* True for RGB not YCbCr */
|
||||||
|
|
||||||
GMutex *write_lock; /* Lock TIFF*() calls with this */
|
GMutex *write_lock; /* Lock TIFF*() calls with this */
|
||||||
} TiffWrite;
|
} TiffWrite;
|
||||||
@ -529,7 +532,8 @@ write_tiff_header( TiffWrite *tw, TIFF *tif, int width, int height )
|
|||||||
}
|
}
|
||||||
else if( tw->compression == COMPRESSION_JPEG &&
|
else if( tw->compression == COMPRESSION_JPEG &&
|
||||||
tw->im->Bands == 3 &&
|
tw->im->Bands == 3 &&
|
||||||
tw->im->BandFmt == VIPS_FORMAT_UCHAR ) {
|
tw->im->BandFmt == VIPS_FORMAT_UCHAR &&
|
||||||
|
!tw->rgbjpeg ) {
|
||||||
/* This signals to libjpeg that it can do
|
/* This signals to libjpeg that it can do
|
||||||
* YCbCr chrominance subsampling from RGB, not
|
* YCbCr chrominance subsampling from RGB, not
|
||||||
* that we will supply the image as YCbCr.
|
* that we will supply the image as YCbCr.
|
||||||
@ -1291,7 +1295,8 @@ make_tiff_write( VipsImage *im, const char *filename,
|
|||||||
gboolean pyramid,
|
gboolean pyramid,
|
||||||
gboolean squash,
|
gboolean squash,
|
||||||
VipsForeignTiffResunit resunit, double xres, double yres,
|
VipsForeignTiffResunit resunit, double xres, double yres,
|
||||||
gboolean bigtiff )
|
gboolean bigtiff,
|
||||||
|
gboolean rgbjpeg )
|
||||||
{
|
{
|
||||||
TiffWrite *tw;
|
TiffWrite *tw;
|
||||||
|
|
||||||
@ -1313,6 +1318,7 @@ make_tiff_write( VipsImage *im, const char *filename,
|
|||||||
tw->onebit = squash;
|
tw->onebit = squash;
|
||||||
tw->icc_profile = profile;
|
tw->icc_profile = profile;
|
||||||
tw->bigtiff = bigtiff;
|
tw->bigtiff = bigtiff;
|
||||||
|
tw->rgbjpeg = rgbjpeg;
|
||||||
tw->write_lock = NULL;
|
tw->write_lock = NULL;
|
||||||
|
|
||||||
tw->resunit = get_resunit( resunit );
|
tw->resunit = get_resunit( resunit );
|
||||||
@ -1531,7 +1537,8 @@ vips__tiff_write( VipsImage *in, const char *filename,
|
|||||||
gboolean pyramid,
|
gboolean pyramid,
|
||||||
gboolean squash,
|
gboolean squash,
|
||||||
VipsForeignTiffResunit resunit, double xres, double yres,
|
VipsForeignTiffResunit resunit, double xres, double yres,
|
||||||
gboolean bigtiff )
|
gboolean bigtiff,
|
||||||
|
gboolean rgbjpeg )
|
||||||
{
|
{
|
||||||
TiffWrite *tw;
|
TiffWrite *tw;
|
||||||
int res;
|
int res;
|
||||||
@ -1553,7 +1560,7 @@ vips__tiff_write( VipsImage *in, const char *filename,
|
|||||||
if( !(tw = make_tiff_write( in, filename,
|
if( !(tw = make_tiff_write( in, filename,
|
||||||
compression, Q, predictor, profile,
|
compression, Q, predictor, profile,
|
||||||
tile, tile_width, tile_height, pyramid, squash,
|
tile, tile_width, tile_height, pyramid, squash,
|
||||||
resunit, xres, yres, bigtiff )) )
|
resunit, xres, yres, bigtiff, rgbjpeg )) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
if( tw->pyramid ) {
|
if( tw->pyramid ) {
|
||||||
if( !(tw->bname = vips__temp_name( "%s.tif" )) ||
|
if( !(tw->bname = vips__temp_name( "%s.tif" )) ||
|
||||||
|
@ -276,7 +276,6 @@ vips_buffer_undone( VipsBuffer *buffer )
|
|||||||
{
|
{
|
||||||
if( buffer->done ) {
|
if( buffer->done ) {
|
||||||
VipsBufferCache *cache = buffer->cache;
|
VipsBufferCache *cache = buffer->cache;
|
||||||
VipsBufferThread *buffer_thread = cache->buffer_thread;
|
|
||||||
|
|
||||||
#ifdef DEBUG_VERBOSE
|
#ifdef DEBUG_VERBOSE
|
||||||
printf( "vips_buffer_undone: thread %p removing "
|
printf( "vips_buffer_undone: thread %p removing "
|
||||||
@ -285,9 +284,9 @@ vips_buffer_undone( VipsBuffer *buffer )
|
|||||||
#endif /*DEBUG_VERBOSE*/
|
#endif /*DEBUG_VERBOSE*/
|
||||||
|
|
||||||
g_assert( cache->thread == g_thread_self() );
|
g_assert( cache->thread == g_thread_self() );
|
||||||
g_assert( buffer_thread->thread == cache->thread );
|
g_assert( cache->buffer_thread->thread == cache->thread );
|
||||||
g_assert( g_slist_find( cache->buffers, buffer ) );
|
g_assert( g_slist_find( cache->buffers, buffer ) );
|
||||||
g_assert( buffer_thread == buffer_thread_get() );
|
g_assert( cache->buffer_thread == buffer_thread_get() );
|
||||||
|
|
||||||
cache->buffers = g_slist_remove( cache->buffers, buffer );
|
cache->buffers = g_slist_remove( cache->buffers, buffer );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user