Commit Graph

7593 Commits

Author SHA1 Message Date
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Michael Natterer 559a758581 Bug 776516 - Saving over existing GZ or BZ2 compressed files...
...does not truncate them

Pass O_TRUNC to g_open() when creating the target files.
2017-01-03 15:11:45 +01:00
Jehan 3bab69310e plug-ins: variable alignement.
Extreme nitpicking on commit 6e608f6, I'm sorry!
I just couldn't let go this very slightly misaligned variable.
2017-01-01 19:16:32 +01:00
Michael Schumacher 1ed5def8e7 Bug 728633 - Improvements to the file-raw plugin
Merge branch bug-728633 to introduce the file-data-raw changes.
2016-12-30 21:41:38 +01:00
Michael Schumacher 779649bdb7 Merge branch 'master' into bug-728633 2016-12-30 21:14:44 +01:00
Ell ce9e7feabd metadata: small fix 2016-12-30 14:49:59 -05:00
Ell 69adce4c75 metadata: don't truncate IPTC values
... since they're (theoretically) user-editable
2016-12-30 09:24:49 -05:00
Ell f8e291bf31 Bug 769112 - The metadata windows takes a lot of CPU.
Exif tags may have long values, which can choke GTK if we display
them in their entirety.  Truncate tag values (based on type, and
with proper indication) to avoid that.

This commit also hides private tags, and fixes some memory leaks.
2016-12-29 22:10:38 -05:00
Michael Schumacher b6e7d19e4f Merge branch 'master' into bug-728633 2016-12-26 20:01:06 +01:00
Cameron Gregory 6e608f6aae Bug 626494 - Enhancement to script-fu-server logging to output milliseconds taken 2016-12-24 23:42:48 +01:00
Ell f91e2a94a7 imagemap: clear preview area background before drawing image
Previously, we neither cleared the preview area's buffer, nor set
its max size, so if the preview area was bigger than the image, the
rest of the widget would display garbage.

This is an ad-hoc-ish fix, simply filling the preview area's buffer
with the background color prior to drawing the image.  Anything
more sophisticated will have to wait till image maps are cool
again, I guess :)
2016-12-20 14:13:58 -05:00
Jehan 0cdca57d12 plug-ins: use an epsilon to compare double values.
Also take into account the case when the minimum possible print
resolution is higher than the expected image resolution. We don't want
to remember the print resolution if it is this lower value either.
See commit 7335dc8.
2016-12-20 16:21:08 +01:00
Jehan 7335dc8dc2 Bug 776017 - Print resolution changes not taken in account...
... for second printing.
Do not save in parasite the resolution used in the print plug-in when
it is the image intended resolution. This allows to take into account
changes of print resolution in successive printing. Only save it when
different since one may have reasons and we should not interfere.
2016-12-20 16:20:36 +01:00
Jehan 4827116ac9 plug-ins: add a "Load Defaults" button to reset print resolution...
... in the print plug-in.
The resolution set during printing may be different from the print size,
for various reason (home printing vs. printshop for instance). The print
plug-in's resolution is saved and reused from a non-persistent parasite,
thus masking actual intended print resolution. Adding this button allows
to reset this temporary value to the intended resolution at any time.
2016-12-20 16:20:27 +01:00
Pascal Massimino 136ef67b64 Bug 775026 - webp-save: expose more saving options in the UI
webp-save: Add UI elements for 'minimize size' toggle, and a dependent
'max key-frame distance' setting.
* If 'minimize size' is active, max-kf is disabled (which is equivalent to
  setting it to infinity). Key-frame cost file size, that's why.
* If 'minimize size' is disabled, you get to choose how far key-frames
  (=cue points) will be inserted at max.
2016-11-26 00:55:19 +01:00
Jehan c5edf05cf0 plug-ins: code cleaning and improved error handling.
- WebPPictureImportRGB(A)() docs say these functions return "false in
  case of memory error". Handle such cases.
- status was not updated when WebPEncode() would fail in save_layer().
- gegl_buffer_flush() is unnecessary just before last unref-ing GEGL
  buffers. This is done automatically at destruction.
- Destroy resources at the same level as they were created if possible.
  This makes the code more readable and maintainable. Consequently
  better not unref parameter GEGL buffers inside combine_buffers().
- Some minor formatting cleanup.
2016-11-23 20:13:13 +01:00
Pascal Massimino 4f67b16dad Bug 774472 - animated-webp: saved layers are not alpha-composited before compression
when saving as animated-webp, use Gegl:over to composite current layer
with the previous frame if needed.
2016-11-23 20:13:13 +01:00
Jehan ad339d3bad plug-ins: tab cleaning. 2016-11-23 00:39:53 +01:00
Thomas Manni 8b25891ddd plug-ins: port smooth-palette to gegl 2016-11-22 19:56:44 +01:00
Michael Natterer cc12c3a0d7 plug-ins: lots of cleanup in file-webp-dialog.c 2016-11-15 01:39:38 +01:00
Jehan 4c1cb9a84b plug-ins: rename "Preset" to "Source type" in WebP export dialog.
The "Preset" feature changes encoding parameters not exposed in our GUI.
Thus it looks like the option is broken as whatever you select, nothing
is updated in the export dialog.
This is also inconsistent with what we call presets in the rest of GIMP:
they are used to save and load values for all fields as a dynamic and
editable list (whereas here that's a pre-defined list in libwebp setting
only a subset of options).

`cwebp` manual defines "preset" as: "Specify a set of pre-defined
parameters to suit a particular type of source material."

Thus call the field "Source type" and add a tooltip "WebP encoder preset"
so that people don't expect a way to save settings whereas the ones used
to the WebP encoder parameters still find their way.
2016-11-15 01:11:37 +01:00
Michael Natterer 700da2a0f8 plug-ins: re-apply some of Jehan's cleanups 2016-11-15 00:25:20 +01:00
Pascal Massimino 1afa322c57 Bug 773450 - Animated WEBP images should be able to set frame delay...
...in the export dialog

- change the *preset field to a proper enum
- clean-up some code related to preset
- change the UI dialogs to use a GimpIntComboBox
- misc style fixes
- quite modified by mitch to be much less code
2016-11-15 00:23:25 +01:00
Michael Natterer f57a61cdbf Revert "Bug 773450 - Animated WEBP images should be able to set frame delay.."
This reverts commit 9ac455f4ad.
2016-11-15 00:23:15 +01:00
Michael Natterer d9da211f9d Revert "plug-ins: various fixes and nitpicking to file-webp."
This reverts commit 58e6f6ca35.

Sorry, I have a patch that gets rid of most code from the original patch.
Will re-apply some of your cleanups later.
2016-11-15 00:22:30 +01:00
Jehan 58e6f6ca35 plug-ins: various fixes and nitpicking to file-webp.
- get_preset_from_id() was defined in file-webp-dialog.c but used in
  file-webp.c only. Move it there.
- Make the preset list available in file-webp-save.h header (since it
  is specifically an encoder attribute) as static, because it is used
  both in the dialog ("preset" choice list) and the main file (for match
  of the "preset" parameter as internal ID to a WebPPreset when run as
  non-interactive).
- Generate the "preset" parameter description from the preset list.
  This way, even if this list were to change (in some hypothetical
  future), the description (and in particular the list of possible
  values and their int match) won't end up wrong.
- "enum WebPPreset" is typedef-ed to "WebPPreset".
- Use G_N_ELEMENTS to compute length of arrays on the stack (equivalent
  to the current code but shorter and simpler to read).
- Many formatting fixes.
2016-11-14 23:50:26 +01:00
Pascal Massimino 9ac455f4ad Bug 773450 - Animated WEBP images should be able to set frame delay..
- change the *preset field to a proper enum
- clean-up some code related to preset
- change the UI dialogs to use a GimpIntComboBox.
- misc style fixes
2016-11-14 23:50:26 +01:00
Pascal Massimino 5e6a1083fd Bug 773450 - Animated WEBP images should be able to set frame delay...
...in the export dialog

Read back timestamps into layer names. Adds the exact duration to the
layer names. Previously, they were not reloaded correctly.
2016-11-14 23:30:14 +01:00
Michael Natterer d3d1ce246d Bug 770897 - Opening and overwriting a linear gamma tiff produces wrong colors
Add support for writing linear TIFFs, the same way as for PNG in
commit e404e6ba93, please test.
2016-11-08 18:41:12 +01:00
Mihail Zenkov 07eb13c73d Bug 769976 - JPEG export ignores quality setting and subsampling fix.
Set use_orig_quality when both the quality and the subsampling are the
same as in the originally-imported jpeg.

Also improve subsampling initial selection: use the original subsampling
unless the default one is the best or the original one is the worst.
The current code was wrong and would often use the default subsampling
even when worse than the original one.
2016-11-08 16:09:37 +01:00
Jehan 294d92250c plug-ins: fixing error popup when canceling webp export.
Even when the export dialog does not end as success, we must cleanly
exit the plugin by setting the return values.
2016-11-08 03:48:49 +01:00
Jehan 9ab041d36a plug-ins: small typo fix - s/framese/frames/ 2016-11-08 01:39:42 +01:00
Jehan 8fdee80ff8 plug-ins: clean and fix webp export.
- Default parameters must be set before gimp_get_data(). Otherwise
  when you export the first time, you end up with broken defaults
  (basically everything to 0, in particular a problem with quality
  values of 0 which makes an export failure).
- Some minor formatting here and there and an unused variable.
2016-11-08 01:39:32 +01:00
Pascal Massimino d516f9bef8 Bug 773450 - Animated WEBP images should be able to set frame delay.
animated webp saving: parse time-stamp from layer_name (instead of using
default value of '100')

also:
- add a default delay field to UI, in case time-stamps are not present.
- add a 'force delay' checkbox
- revamp the whole UI to look like the GIF saving UI.
2016-11-08 01:32:49 +01:00
Michael Natterer 46bcd82800 Bug 773233 - CVE-2007-3126 - Gimp 2.3.14 allows context-dependent attackers...
...to cause a denial of service (crash) via an ICO file with an
InfoHeader containing a Height of zero

Add some error handling to ico-load.c and bail out on zero width or height
icons. Also some formatting cleanup.
2016-11-06 21:34:43 +01:00
Pascal Massimino 21d8c00d16 plug-ins: make file_gif_spin_button_int_init() generic.
Use the `value_pointer` parameter instead of modifying the globale
`gsvals.default_delay`. This doesn't change anything in current code
where file_gif_spin_button_int_init() is only used for connecting this
variable to the delay spin button, but could have been a problem if it
were reused in the future.
2016-11-06 18:04:32 +01:00
Jehan e83ed61178 plug-ins: cleaning out some indentation tabs. 2016-11-03 23:02:19 +01:00
Elle Stone ccb30a625c Bug 765850 - Deal with libpng error gracefully when exporting...
...an image with the color profile "sRGB IEC61966-2.1"

Eliminate libpng warnings about known incorrect sRGB profiles.

These "known incorrect sRGB profiles" are only considered "incorrect"
by libpng. Such profiles are perfectly good sRGB profiles currently
being embedded by PhotoShop 5 and 6 and also already embedded in many,
many images on the web.
2016-10-31 09:41:28 +01:00
Michael Natterer f5ecc53f3e Fix a lot of warnings all over the place
Deprecated stuff, unused variables. Includes parts of a patch from
Shlomi Fish from bug #768855.
2016-10-31 01:36:35 +01:00
Michael Natterer 43e218859b Bug 773382 - --without-librsvg broken by tools/Makefile.am
Fixed by making librsvg a hard dependency.
2016-10-30 19:44:28 +01:00
Pascal Massimino 26a6a39b6b fix animation layer order when saving as webp 2016-10-25 16:43:01 +02:00
Matthias Junker-Petschick 3139cb9305 Bug 771558 - PSD files with a layer additional data length...
...not divisible by 4 are incorrectly reported as corrupt

file-psd: Do not round up the extra data length field when reading
layer info.

Fixes the PSD layer extra information handling in read_layer_info() by
not rounding up the data length field to a multiple of 4.

Layers can contain extra data, which is encoded at the end of layer
records. The length of this data should always be stored rounded up to
an even byte count. When loading a PSD file, it can be expected that
this value is already rounded up and this operation should not be
necessary. If an uneven byte count is encountered, a warning is
emitted but the loading process is not aborted.
2016-10-09 22:29:51 +02:00
Michael Natterer 754b9a849c script-fu: port two scripts to gimp-edit-paste-as-new-image 2016-09-20 20:23:04 +02:00
Pascal Massimino 342c602546 Bug 771012 - Improve WebP animation-saving
WebP saving: various improvements in file-webp-save.c

- reorganizes the main loop
- fixes (temporarily) the bad timestamp by using fixed 100ms delay between frames
- fixes the progress bar
- takes care of resource clean-up for some previously unchecked error paths
- uses 'minimize_size' and 'allow_mixed' options more appropriately
- only remuxes the final bytestream when ICC profile is present. For
  most common case, we insert the loop-count information during muxer
  creation instead of by remuxing at the end.
2016-09-11 20:36:43 +02:00
Michael Natterer 4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Kristian Rietveld b462418dfc plug-ins: common: fix scripts to generate Makefile.am correctly
This complements the preceding commit "plug-ins: fix the build on OS X".
2016-09-07 22:10:19 +02:00
Michael Natterer 4033415a79 app, libgimpwidgets, plug-ins: kill gtk_scrolled_window_add_with_viewport()
It's deprecated in GTK+ 3.x, so we get rid of some deprecation
warnings. Also, it has always only been a utility function that hides
what is really going on in the widget hierarchy.
2016-09-07 20:12:28 +02:00
Kristian Rietveld 51d26b06db plug-ins: fix the build on OS X
We need to have -xobjective-c specified only for compile commands
that will perform compilation. Otherwise, for compile commands
that only link the compiler interprets .o files as C source ...
2016-09-07 10:32:15 +02:00
Michael Natterer 308efbb514 Bug 767830 - Help browser does not launch on OS X
Try harder to show help when webkit is missing or the help browser
won't start:

- offer to switch to the web browser when the help browser is
  present, but won't start for some reason
- in prefs, don't bother showing the help browser GUI when webkit
  is missing, otherwise show a warning label if the help browser
  is not installed even though webkit is there. Switch to the web
  browser in both cases (modified patch from lisanet)
- add OS X replacement for gtk_show_uri() in plug-in-web-browser
  (modified patch from lisanet)
2016-09-06 20:51:47 +02:00
Michael Natterer ee49c0b700 plug-ins: latest perl or whatever seems to need "require './plugin-defs.pl';"
instead of just "require 'plugin-defs.pl';".
2016-09-05 19:35:35 +02:00