Commit Graph

97 Commits

Author SHA1 Message Date
Mukund Sivaraman 8ef1f20c22 file-jpeg: Reduce use of #ifdefs 2014-05-15 13:41:21 +05:30
Mukund Sivaraman c760829161 file-jpeg: Append to parasite fields 2014-05-15 01:38:58 +05:30
Mukund Sivaraman 080fd93d90 file-jpeg: Use state of toggle button with the event 2014-05-15 01:37:16 +05:30
Mukund Sivaraman 7a6b8f0e69 file-jpeg: Add support for arithmetic coding
Arithmetic coding is a feature of the JPEG standard. Although libjpeg
had always implemented arithmetic coding, it was compiled out by default
due to patents.

Those patents have now expired.

libjpeg 8 now enables arithmetic coding by default. Distributions which
use libjpeg < 8 can also support arithmetic coding by using the
appropriate CFLAGS to enable it. libjpeg-turbo 1.3.1 also has support
for arithmetic coding and is in popular shipping distributions.

Software such as jpegtran can losslessly convert Huffman compressed
images to arithmetic coding and vice versa. The lossy behavior of JPEG
does not happen at this (bit coding) layer of the format.

This initial patch provides a checkbox (disabled by default) to create
files which use arithmetic coding. It also has a tooltip warning that
such files may not be compatible with older decoders.
2014-05-15 00:57:42 +05:30
Michael Natterer 32e47cf70d libgimpcolor: add gimp_lcms_profile_is_equal()
and remove all of our own MD5 digest code and API. is_equal() uses
lcms' own MD5 API which I missed before. Thanks Elle for pointing that
out :)
2014-03-29 10:40:47 +01:00
Michael Natterer b3395d989e libgimpcolor: return an optional MD5 digest from gimp_lcms_create_srgb_profile()
pass NULL in most places, use the feature in the lcms.c plu-gin.
2014-03-23 23:34:47 +01:00
Michael Natterer ebc53672cb libgimpcolor: add gimp_lcms_profile_is_rgb() and _is_cmyk()
And change all lcms code to use it.
2014-03-15 21:47:13 +01:00
Elle Stone 05c5ca3216 Bug 723787 - Neutral sRGB profile matching Argyllcms sRGB.icm
Add gimp_lcms_create_srgb_profile() to libgimpcolor and use it where
we used to call cmsCreate_sRGBProfile().
2014-02-09 23:10:56 +01:00
Michael Natterer 03df8c6af4 plug-ins: pass the format's name again in calls to gimp_export_image()
and clean up the formatting of the call and the lines around it. Now
we can check the various (disabled) export options for regressions
again by changing a single line in gimp_export_image().
2013-11-10 00:18:48 +01:00
Nils Philippsen a9376443d7 file-jpeg: fix operator precedence errors 2013-11-07 12:20:34 +01:00
Michael Natterer 8812abee0a plug-ins: save the metadata of the orig_image_ID in file-jpeg-save
The image_ID might be an export image and already deleted.
2013-11-05 08:49:40 +01:00
Michael Natterer 7bd4d2678a configure, plug-ins, modules: make lcms a hard dependency 2013-11-03 21:19:51 +01:00
Michael Natterer 49758867fc plug-ins: load the JPEG thumbnail using the new libgimp API 2013-10-30 00:06:05 +01:00
Michael Schumacher 8db3b4312d Global EXIF -> Exif string change (official spelling) 2013-10-29 22:48:46 +01:00
Michael Natterer 7752873add plug-ins: trust the TIFF's resolution over its metadata's resolution
This also sortof addresses bug #691231, but fixes the issue only
indirectly by not perferring the EXIF resolution.
2013-10-27 18:52:46 +01:00
Michael Natterer a44e06d059 plug-ins: reverse the logic for setting GimpMetadataSaveFlags
start with flags = ALL (which now includes all possible current and
future flags), and optionally *remove* individual flags instead of
adding them. This way the plug-ins default to TRUE for future flags.
2013-10-27 15:38:42 +01:00
Michael Natterer 7cbe83d911 libgimp,plug-ins: split metadata loading into prepare() and finish()
So the plug-in has the chance to decide whether it wants to trust the
metadata information (e.g. resolution). Also reorder parameters in
gimp_image_metadata_save_finish(). Change all plug-ins accordingly.
2013-10-27 15:22:35 +01:00
Hartmut Kuhse 21bed1e2fb Completely rewrite metadata handling using gexiv2
Based on original patches from Hartmut Kuhse and modified
by Michael Natterer. Changes include:

- remove libexif dependency and add a hard dependency on gexiv2
- typedef GExiv2Metadata to GimpMetadata to avoid having to
  include gexiv2 globally
- add basic GimpMetadata handling functions to libgimpbase
- add image and image file specific metadata functions to libgimp,
  including the exif orientation image rotate dialog
- port plug-ins to use the new APIs
- port file-tiff-save's UI to GtkBuilder
- add new plug-in "metadata" to view the image's metadata
- keep metadata around as GimpImage member in the core
- update the image's metadata on image size, resolution and precision
  changes
- obsolete the old metadata parasites
- migrate the old parasites to new GimpMetadata object on XCF load
2013-10-27 01:02:17 +02:00
Michael Natterer 54ead10b57 plug-ins: simplify the file-jpeg file size displaying code
and display errors returned by g_file_query_info().
2013-10-12 18:53:03 +02:00
Michael Natterer 1f21a28770 Bug 703065 - Jpeg file size preview error is back
Use GIO to get the file size.
2013-10-05 00:14:14 +02:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Massimo Valentini bcc68763d6 file-jpeg: get data with alpha already stripped
otherwise the buffer allocated to locally ignore it
was smaller than necessary
2013-05-17 18:04:00 +02:00
Massimo Valentini a6c00399e8 file-jpeg: explicitely set babl_format when loading the image
when loading the image used for the preview,
it could be different from that of the layer
(u8 vs float for example)
2013-05-17 18:04:00 +02:00
Mukund Sivaraman 0ae7894f87 file-jpeg: Fix load/save for different precisions 2013-05-14 13:35:47 +05:30
Michael Natterer 7fbec0ea17 plug-ins: link file-jpeg against GEGL_LIBS 2013-05-13 09:11:09 +02:00
Mukund Sivaraman c4dcc517a4 file-jpeg: GEGL convert save functions 2013-05-13 12:25:32 +05:30
Mukund Sivaraman 3cb0b2f35e file-jpeg: unref GeglBuffer in case of a problem (contd.)
The duplicate code in load_image() and load_thumbnail_image() should be
merged at some point into a single function.
2013-05-13 11:50:03 +05:30
Mukund Sivaraman b6a2d45821 file-jpeg: unref GeglBuffer in case of a problem 2013-05-13 11:46:52 +05:30
Mukund Sivaraman 51680fb987 file-jpeg: GEGL convert load functions
drawable_global doesn't seem to be used anywhere. This commit removes
it.
2013-05-13 11:42:10 +05:30
Kevin Cozens cc20c8d7f6 Fixed several typos. Minor whitespace changes. 2012-12-14 17:43:10 -05:00
Massimo Valentini ef5cd8d80a Bug 686379: In the JPEG save dialog, checking/unchecking XMP...
saving, don't update JPEG size
2012-10-22 18:26:05 +02:00
Michael Natterer 8bbfc9e5cf Bug 675558 - switch from lcms-1 to lcms-2
Applied modified patch from Hartmut Kuhse which ports to lcms-2.
2012-09-03 20:03:53 +02:00
Massimo Valentini c09414b8b7 Bug 682454: Plug-in crashed
plug-in-metadata-decode-exif makes use of the exif parasite
attached to the image few lines above.

and exif_data->size is the size of the thumbnail buffer that
starts at exif_data->data and not at exif_data.

==4677== Invalid read of size 1
==4677==    at 0x4A0A130: memcpy@@GLIBC_2.14 (/builddir/build/BUILD/valgrind-3.7.0/memcheck/mc_replace_strmem.c:837)
==4677==    by 0x4E440F8: gimp_write (gimp-2-8/libgimp/gimp.c:1726)
==4677==    by 0x5BDD27E: gimp_wire_write (gimp-2-8/libgimpbase/gimpwire.c:174)
==4677==    by 0x5BD9D41: _gp_params_write (gimp-2-8/libgimpbase/gimpprotocol.c:1748)
==4677==    by 0x5BDDA46: gimp_wire_write_msg (gimp-2-8/libgimpbase/gimpwire.c:296)
==4677==    by 0x5BDAE17: gp_proc_run_write (gimp-2-8/libgimpbase/gimpprotocol.c:305)
==4677==    by 0x4E4513E: gimp_run_procedure2 (gimp-2-8/libgimp/gimp.c:993)
==4677==    by 0x4E4544B: gimp_run_procedure (gimp-2-8/libgimp/gimp.c:926)
==4677==    by 0x40BD36: gimp_metadata_store_exif (gimp-2-8/plug-ins/file-jpeg/gimpexif.c:69)
==4677==    by 0x406EA4: load_image (gimp-2-8/plug-ins/file-jpeg/jpeg-load.c:343)
==4677==    by 0x405A2E: run (gimp-2-8/plug-ins/file-jpeg/jpeg.c:235)
==4677==    by 0x4E44AD8: gimp_main (gimp-2-8/libgimp/gimp.c:1992)
==4677==    by 0x30A0421734: (below main) (in /usr/lib64/libc-2.15.so)
==4677==  Address 0x8f75e01 is 1 bytes after a block of size 64 alloc'd
==4677==    at 0x4A06F18: calloc (/builddir/build/BUILD/valgrind-3.7.0/coregrind/m_replacemalloc/vg_replace_malloc.c:566)
==4677==    by 0x8AC304B: exif_data_new_mem (/home/massimo/libexif/libexif/exif-data.c:111)
==4677==    by 0x8AC312D: exif_data_new (/home/massimo/libexif/libexif/exif-data.c:95)
==4677==    by 0x407224: load_image (gimp-2-8/plug-ins/file-jpeg/jpeg-load.c:311)
2012-08-26 17:41:25 +02:00
Massimo Valentini cac0504f29 Bug 675981: Export as JPEG "save defaults" "load defaults" doesn't work
oversight
2012-05-18 17:20:52 +02:00
Michael Natterer f888792a77 plug-ins: return image type and #layers from the JPEG thumbnail procedure 2012-05-02 17:51:03 +02:00
Øyvind Kolås d1ced11415 plug-ins: add GEGL_CFLAGS to many Makefile.am's 2012-05-02 17:46:08 +02:00
Michael Natterer 9781aa65ea Bug 658467 - Replace g_format_size_for_display() by g_format_size()
Use g_format_size() instead of g_format_size_for_display() because
the latter is deprecated.
2011-11-30 23:37:55 +01:00
Mukund Sivaraman 211dfb0ce1 file-jpeg: Fix format specifiers 2011-10-03 10:59:48 +05:30
Mukund Sivaraman a7604f706d file-jpeg: Save and restore use_orig_quality 2011-09-30 18:31:28 +05:30
Mukund Sivaraman aa2a876d22 file-jpeg: Rename load_save_defaults() to load_defaults() 2011-09-30 18:31:27 +05:30
Michael Natterer dcb4c6e34a plug-ins: use gtk_box_new() 2011-09-30 12:18:24 +02:00
Mukund Sivaraman ecacdbc7cd file-jpeg: Conditionally compile files with EXIF related code 2011-09-18 08:09:41 +05:30
Mukund Sivaraman bd3faae04c file-jpeg: Include gimpexif.h only if HAVE_LIBEXIF 2011-09-18 08:08:16 +05:30
Mukund Sivaraman cbed71eb30 file-jpeg: Conditionally declare orientation 2011-09-18 08:07:32 +05:30
Mukund Sivaraman dfdf05a578 file-jpeg: Add header cladding 2011-09-18 08:00:20 +05:30
Mukund Sivaraman 50b093d92c file-jpeg: Move define to header file 2011-09-18 07:22:38 +05:30
Mukund Sivaraman f6b70ec3e9 file-jpeg: Remove unused define 2011-09-18 07:22:06 +05:30
Mukund Sivaraman 536d6a527c file-jpeg: Create jpeg-exif.h and move EXIF protos to it 2011-09-18 07:21:30 +05:30
Mukund Sivaraman 2aae54226c build: Rename HAVE_EXIF define to HAVE_LIBEXIF 2011-09-18 07:04:44 +05:30