diff --git a/TODO b/TODO index d93368b6..0e06b9c7 100644 --- a/TODO +++ b/TODO @@ -1,9 +1,9 @@ -- get image.c using the new system +- try jpeg save + + get image.c using the new system move format/* to deprecated - try jpeg save - try tiff load diff --git a/libvips/file/jpegsave.c b/libvips/file/jpegsave.c new file mode 100644 index 00000000..7355c632 --- /dev/null +++ b/libvips/file/jpegsave.c @@ -0,0 +1,164 @@ +/* save to jpeg + * + * 28/11/03 JC + * - better no-overshoot on tile loop + * 12/11/04 + * - better demand size choice for eval + * 30/6/05 JC + * - update im_error()/im_warn() + * - now loads and saves exif data + * 30/7/05 + * - now loads ICC profiles + * - now saves ICC profiles from the VIPS header + * 24/8/05 + * - jpeg load sets vips xres/yres from exif, if possible + * - jpeg save sets exif xres/yres from vips, if possible + * 29/8/05 + * - cut from old vips_jpeg.c + * 20/4/06 + * - auto convert to sRGB/mono for save + * 13/10/06 + * - add +#endif /*HAVE_CONFIG_H*/ +#include + +#include +#include +#include +#include + +#ifdef HAVE_EXIF +#ifdef UNTAGGED_EXIF +#include +#include +#include +#include +#else /*!UNTAGGED_EXIF*/ +#include +#include +#include +#include +#endif /*UNTAGGED_EXIF*/ +#endif /*HAVE_EXIF*/ + +#include +#include +#include + +/* jpeglib includes jconfig.h, which can define HAVE_STDLIB_H ... which we + * also define. Make sure it's turned off. + */ +#ifdef HAVE_STDLIB_H +#undef HAVE_STDLIB_H +#endif /*HAVE_STDLIB_H*/ + +#include +#include + +typedef struct _VipsFileSaveJpeg { + VipsFileSave parent_object; + + +} VipsFileSaveJpeg; + +typedef VipsFileSaveClass VipsFileSaveJpegClass; + +G_DEFINE_TYPE( VipsFileSaveJpeg, vips_file_save_jpeg, VIPS_TYPE_FILE_SAVE ); + +static int +vips_file_load_save_build( VipsObject *object ) +{ + VipsFileSaveJpeg *jpeg = (VipsFileSaveJpeg *) object; + + if( VIPS_OBJECT_CLASS( vips_file_save_jpeg_parent_class )-> + build( object ) ) + return( -1 ); + + return( 0 ); +} + +static void +vips_file_save_jpeg_class_init( VipsFileLoadJpegClass *class ) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS( class ); + VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsFileSaveClass *save_class = (VipsFileSaveClass *) class; + + gobject_class->set_property = vips_object_set_property; + gobject_class->get_property = vips_object_get_property; + + object_class->nickname = "jpegsave"; + object_class->description = _( "save jpeg from file" ); + object_class->build = vips_file_save_jpeg_build; + +} + +static void +vips_file_save_jpeg_init( VipsFileSaveJpeg *jpeg ) +{ +} +