StudyGlib/app/src/main/cpp/study/type.c
/* Transform ablob to a save string and back.
 */
Transform ablob to a save string and back.
Transform ablob to a save string and back .
static void
transform_blob_save_string( const GValue *src_value, GValue *dest_value )
{
    void *blob;
    size_t length;
    char *b64;
    blob = vips_value_get_blob( src_value, &length );
    if( (b64 = g_base64_encode( blob, length )) ) {
        vips_value_set_save_string( dest_value, b64 );
        g_free( b64 );
    }
    else
        vips_value_set_save_string( dest_value, "" );
}
static void transform_blob_save_string ( const GValue * src_value , GValue * dest_value ) { void * blob ; size_t length ; char * b64 ; blob = vips_value_get_blob ( src_value , & length ) ; if ( ( b64 = g_base64_encode ( blob , length ) ) ) { vips_value_set_save_string ( dest_value , b64 ) ; g_free ( b64 ) ; } else vips_value_set_save_string ( dest_value , " " ) ; }
Transform ablob to a save string and back.
Transform ablob to a save string and back .
/* No error return from transform, but we should set it to
         * something.
         */