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)
Add support for writing linear PNGs. But only if we also save a color
profile, otherwise we would get loaders confused. Please test, I might
have a knot in my brain...
Also clean up some formatting and fix compile warnings, now let's wait
for bugs about shit libpng versions which break the build.
- handle all sorts of image types, gegl_buffer_get() will convert to u8
- specify GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION
- modify the export duplicate, not the original image
- fix handling of the drawable type and only save "R'G'B'A u8"
or "R'G'B' u8", fixes bug 770664.
- completely redo run(SAVE_PROC) to deal with export correctly
- turn global variables into the standard SAVE_PROC, PLUG_IN_BINARY etc
defines
- simplify the save dialog
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.
s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/
s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
This adds an expander to the webp file plug-in to select whether
to save or not the exif, and xmp data for webp files. This harmonizes
the plug-in with a similar option to the jpg/png file plug-ins.
https://bugzilla.gnome.org/show_bug.cgi?id=769871
Before commit 20523c61ac
PF_FILE used to open a "open file" filechooser dialog.
That commit, while adding the ability to open
a "save dialog" filechooser dialog using PF_FILENAME,
changed the behavior of the existing gimpfu PF_FILE type.
Restore the previous behavior and update the
built-in plug-ins using a save dialog to the new
PF_FILENAME.
FileChooser 'action' and 'buttons' should be consistent
and call set_alternative_button_order to be consistent
on platforms using the alternative button order.
Remove gimp_ui_init call from gimpui module initialization.
Add gimp_ui_init method to gimpui module and call it from
gimpplugin _run method before running the user code.
Completing fix from commit 3cb70e6.
Checking further into libtiff logs, I can see another version of the
warning message for private tags which was used before libtiff 3.7.
For sake of completeness, let's check against this version of the
warning as well.
This is a regression from bug 131975. Any unknown tag over 32768 is not
an error. This is a reserved zone where it is allowed to create custom
tags.
The warning indeed changed since libtiff 4.0.0alpha where it has become:
"Unknown field with tag %d (0x%x) encountered"
This explains why it was not recognized anymore.
Rather than just discovering them by chance, a simple grep and some
search and replace are much more efficient! :-)
Cleaning only done on C and automake files.
xdg-email would usually open an email client where you can edit all
fields, like recipients, mail title, etc. Setting it first in GIMP
is redundant.
Of course, these fields can still be set in non-interactive mode (in
which case, maybe xdg-email could be set to some non-interactive email
client as well).
By default, it will now use xdg-email to select the user's preferred
email client, which means it only works on platforms with xdg-email.
The sendmail implementation is still available if requested explicitly
with --with-sendmail.
We need to bind deprecated methods and cannot just implement these using
the replacements. So therefore, do not disturb us with deprecation
warnings for these files.
gimpui.c is the language binding which is generated from gimpui.defs.
We need to bind deprecated methods, so please do not disturb us
with deprecation warnings for this file.
We need to run raw_input in modal mode, such that we can return the
text that has been entered as the return value. This makes the use
of "raw_input()" within the pyconsole work as well as makes "help()"
not get stuck (it was blocking on input on stdin).
Fixes the plug-in output to render decimal digit
characters as octal escaped, so they can't be acidentally
combined in preceding escaped sequences. (i.e. the sequence
of values '255, 49' is now rendered as '\377\049' instead of
'\3771')
Thanks Steve Baker for noticing and reporting the issue.
The reported size isn't very precise but close enough to get an idea of
what you will get. The problem is that raw files always have some unused
regions that get cropped away later.
Another source of discrepancy can be manual cropping by the user in
darktable, but there isn't much we can do about that.
Before there wouldn't be any intermediate file being written when
darktable sees more than one XMP file. Now the first image in its
temporary database gets exported.
Don't skip the first 10 bytes. That code was there to skip the magic
"GIMP_XMP_1" of the old "gimp-metadata" parasite. Instead, properly
check for that magic in xcf_load_image() and pass only the actual XMP
to gimp_metadata_set_from_xmp(). Also remove the +10 hack in file-exr.