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.
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 :)
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.
... 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.
... 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.
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.
- 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.
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.
...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
- 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.
- 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
...in the export dialog
Read back timestamps into layer names. Adds the exact duration to the
layer names. Previously, they were not reloaded correctly.
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.
- 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.
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.
...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.
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.
...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.
...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.
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.
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.
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 ...
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)