vips7wrap works for non-image output
"vips max x.jpg" now works
This commit is contained in:
parent
9078df3c7b
commit
7fdeb1789b
16
TODO
16
TODO
|
@ -1,8 +1,3 @@
|
||||||
- try
|
|
||||||
|
|
||||||
$ vips max poop.jpg --vips-leak
|
|
||||||
|
|
||||||
need to implement output double args in wrapvips7.c
|
|
||||||
|
|
||||||
- try
|
- try
|
||||||
|
|
||||||
|
@ -44,10 +39,17 @@
|
||||||
additionally, exif tags can be in one of several ifd blocks, do we need to
|
additionally, exif tags can be in one of several ifd blocks, do we need to
|
||||||
add the tag to the correct block? how do we save that information?
|
add the tag to the correct block? how do we save that information?
|
||||||
|
|
||||||
probably not possible with libexif, better to pass the problem to another
|
oo! we have the original, of course
|
||||||
library and simply provide operations to add and remove whole exif blocks
|
|
||||||
|
|
||||||
|
to reattach, get the entry from the original exif block, get the updated
|
||||||
|
tag, coerce the updated value back to the orginal format
|
||||||
|
|
||||||
|
save exif entries to tags as something like:
|
||||||
|
|
||||||
|
exif-Orientation: 1 (Top-left, Short, 1 component, 2 bytes)
|
||||||
|
|
||||||
|
so we can restore the value from the "1" without needding to look up i18n
|
||||||
|
strings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,8 @@ typedef enum {
|
||||||
VIPS_WRAP7_INTERPOLATE
|
VIPS_WRAP7_INTERPOLATE
|
||||||
} VipsWrap7Type;
|
} VipsWrap7Type;
|
||||||
|
|
||||||
|
/* Order must match VipsWrap7Type enums.
|
||||||
|
*/
|
||||||
static char *vips_wrap7_supported[] = {
|
static char *vips_wrap7_supported[] = {
|
||||||
IM_TYPE_DOUBLE,
|
IM_TYPE_DOUBLE,
|
||||||
IM_TYPE_INT,
|
IM_TYPE_INT,
|
||||||
|
@ -537,6 +539,33 @@ vips_wrap7_build_output( VipsObject *object,
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mark an output as assigned.
|
||||||
|
*/
|
||||||
|
static void *
|
||||||
|
vips_wrap7_note_assigned( VipsObject *object,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
VipsArgumentClass *argument_class,
|
||||||
|
VipsArgumentInstance *argument_instance,
|
||||||
|
void *a, void *b )
|
||||||
|
{
|
||||||
|
/* We want required, construct-time, output args.
|
||||||
|
*/
|
||||||
|
if( !(argument_class->flags & VIPS_ARGUMENT_REQUIRED) ||
|
||||||
|
!(argument_class->flags & VIPS_ARGUMENT_CONSTRUCT) ||
|
||||||
|
!(argument_class->flags & VIPS_ARGUMENT_OUTPUT) )
|
||||||
|
return( NULL );
|
||||||
|
|
||||||
|
if( !argument_instance->assigned ) {
|
||||||
|
argument_instance->assigned = TRUE;
|
||||||
|
|
||||||
|
VIPS_DEBUG_MSG( "vips_wrap7_note_assigned: "
|
||||||
|
"marking %s as assigned\n",
|
||||||
|
g_param_spec_get_name( pspec ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return( NULL );
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
vips_wrap7_build( VipsObject *object )
|
vips_wrap7_build( VipsObject *object )
|
||||||
{
|
{
|
||||||
|
@ -573,9 +602,21 @@ vips_wrap7_build( VipsObject *object )
|
||||||
if( VIPS_OBJECT_CLASS( vips_wrap7_parent_class )->build( object ) )
|
if( VIPS_OBJECT_CLASS( vips_wrap7_parent_class )->build( object ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
|
/* Run the operation.
|
||||||
|
*/
|
||||||
if( class->fn->disp( wrap7->vargv ) )
|
if( class->fn->disp( wrap7->vargv ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
|
/* The vips7 operation will have written any outputs (such as the
|
||||||
|
* output double for im_max(), for example) to varg. g_object_get()
|
||||||
|
* fetches directly from vargv (see vips_wrap7_object_get_property())
|
||||||
|
* so we don't need to do any copying, we just need to tell vips that
|
||||||
|
* all outputs now have values.
|
||||||
|
*/
|
||||||
|
(void) vips_argument_map( VIPS_OBJECT( wrap7 ),
|
||||||
|
vips_wrap7_note_assigned,
|
||||||
|
NULL, NULL );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue