clean up iiif output a bit
better info.json, but still not support for the full/ directory see https://github.com/libvips/libvips/issues/1465
This commit is contained in:
parent
b65a9d7328
commit
74519a230b
@ -944,6 +944,11 @@ write_blank( VipsForeignSaveDz *dz )
|
|||||||
static int
|
static int
|
||||||
write_json( VipsForeignSaveDz *dz )
|
write_json( VipsForeignSaveDz *dz )
|
||||||
{
|
{
|
||||||
|
/* dz->file_suffix has a leading "." character.
|
||||||
|
*/
|
||||||
|
const char *suffix = dz->file_suffix[0] == '.' ?
|
||||||
|
dz->file_suffix + 1 : dz->file_suffix;
|
||||||
|
|
||||||
GsfOutput *out;
|
GsfOutput *out;
|
||||||
char buf[VIPS_PATH_MAX];
|
char buf[VIPS_PATH_MAX];
|
||||||
int i;
|
int i;
|
||||||
@ -958,14 +963,19 @@ write_json( VipsForeignSaveDz *dz )
|
|||||||
" \"http://iiif.io/api/image/2/level0.json\",\n"
|
" \"http://iiif.io/api/image/2/level0.json\",\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" \"formats\": [\n"
|
" \"formats\": [\n"
|
||||||
" \"jpg\"\n"
|
" \"%s\"\n"
|
||||||
" ],\n"
|
" ],\n"
|
||||||
" \"qualities\": [\n"
|
" \"qualities\": [\n"
|
||||||
" \"default\"\n"
|
" \"default\"\n"
|
||||||
" ]\n"
|
" ]\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" ],\n"
|
" ],\n"
|
||||||
" \"protocol\": \"http://iiif.io/api/image\",\n"
|
" \"protocol\": \"http://iiif.io/api/image\",\n", suffix );
|
||||||
|
|
||||||
|
/* "sizes" is needed for the full/ set of untiled images, which we
|
||||||
|
* don't yet support. Leave this commented out for now.
|
||||||
|
|
||||||
|
gsf_output_printf( out,
|
||||||
" \"sizes\": [\n" );
|
" \"sizes\": [\n" );
|
||||||
|
|
||||||
for( i = 0; i < dz->layer->n + 5; i++ ) {
|
for( i = 0; i < dz->layer->n + 5; i++ ) {
|
||||||
@ -983,6 +993,10 @@ write_json( VipsForeignSaveDz *dz )
|
|||||||
gsf_output_printf( out,
|
gsf_output_printf( out,
|
||||||
" ],\n" );
|
" ],\n" );
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* The set of pyramid layers we have written.
|
||||||
|
*/
|
||||||
gsf_output_printf( out,
|
gsf_output_printf( out,
|
||||||
" \"tiles\": [\n"
|
" \"tiles\": [\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
@ -1018,7 +1032,6 @@ write_json( VipsForeignSaveDz *dz )
|
|||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
write_vips_meta( VipsForeignSaveDz *dz )
|
write_vips_meta( VipsForeignSaveDz *dz )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user