Commit Graph

46686 Commits

Author SHA1 Message Date
2ea5dec56e libgimpwidgets: improved gimp_prop_scale_entry_new(), new function…
… gimp_label_spin_set_digits() and deleted gimp_prop_opacity_entry_new()

- The "digits" argument for the number of decimal places in
  gimp_prop_scale_entry_new() is now mostly useless since GimpLabelSpin
  (hence GimpScaleEntry too) got a nice estimation algorithm of sensible
  values.
- Add gimp_label_spin_set_digits() function to manually set the digits
  property when we don't like the estimated value.
- Also add a new "factor" argument to gimp_prop_scale_entry_new(). Its
  role is to allow a GimpScaleEntry showing a factored range, typically
  a [0, 100] range for some types of [0, 1] properties.
- Remove gimp_prop_opacity_entry_new() which was basically a
  special-case of gimp_prop_scale_entry_new() and which can now be
  easily reproduced by simply set factor=100.0.
- Update all usage of gimp_prop_scale_entry_new() in app/ and plug-ins/
  with updated arguments. It is interesting to note that all existing
  usage were either integers (digits=1) or when double, the estimated
  decimal places are the same as the ones which were manually set (hence
  showing the generic estimation is not too bad). So the new function
  gimp_label_spin_set_digits() was not even needed once in current code.
2020-11-25 02:32:22 +01:00
8d5008d76f libgimp, libgimpbase, libgimpwidgets: new gimp_range_estimate_settings()
Similar code was used in 2 places basically (GimpLabelSpin and
GimpProcedureDialog) so just make it an utils function. It's good anyway
to have a generic function to estimate suitable increments and decimal
places depending on a range.

As a consequence also gimp_label_spin_new() now takes a gint digits
(instead of guint), with -1 meaning we want digits computed from the
range.
Similarly gimp_prop_scale_entry_new() docs adds the -1 meaning too.
2020-11-25 01:34:36 +01:00
9ca18c37cd INSTALL: add information about GEGL options to enable for the…
… experimental tool "Paint Select".
2020-11-24 22:07:26 +01:00
78fabc1e47 icons: (meson) install the new icons for the Paint Select tool. 2020-11-24 21:59:45 +01:00
31111d2802 app: mark the paint select tool as experimental.
Otherwise it breaks the toolbox organization with a "missing tools in
toolrc file" error while scanning toolrc.
2020-11-24 21:43:11 +01:00
9f6fbe8aca app: fix generated tool-enums.c and deactivate Paint Select tool…
… checkbox in Preferences when GEGL operation "gegl:paint-select" is
missing.

Otherwise the tool won't appear and you don't understand why.
2020-11-24 21:26:04 +01:00
3fb2ff1b9d libgimp: improvements to GimpProcedureDialog API.
- New gimp_procedure_dialog_fill_box(_list)() functions to create a
  GtkBox in the layout.
- Generating widgets for parameters of type double (and computing
  appropriate "ok defaults" digits for these, depending on the min-max
  range of the property).
2020-11-24 20:55:03 +01:00
e53ce2fde9 libgimp: output a "saving metadata failed" message when relevant.
Similar to the message present in file-jpeg. The latter will anyway
disappear when we will have finally ported file-jpeg to newer
GimpSaveProcedure API, and it's better to have it outputted here so that
it will work for every export formats.
2020-11-24 20:55:03 +01:00
5bbc7899bc menus: remove PaintSelect tool from the menus...
...as long as it stays in the playground.
2020-11-24 20:13:04 +01:00
0b27fec6f9 Update Ukrainian translation 2020-11-24 19:07:24 +00:00
d3260b594b Update Ukrainian translation 2020-11-24 18:59:05 +00:00
9e391bc3b6 app: Paint Select tool, reflect changes applied to the gegl operation...
...related to fluctuations removal.
2020-11-24 19:02:30 +01:00
e1cdb9f54e app, icons: add Paint Select tool in the playground
A -quick done- first step towards the addition of a smart selection tool.
Require the gegl:paint-select workshop operation.
Still LOT of work to do (wip):
- fluctuations removal (GEGL side)
- multilevels pyramid approach + banded graphcut for instant result on large
   image (GEGL ? GIMP ?)
- Gaussian Mixtures for color models (GEGL side)
- drawable offsets (GIMP side)
- undo / redo (GIMP side)
- scribbles edition mode (GIMP side)
- dedicated icons
- ...
2020-11-24 12:10:40 +01:00
3e67d7d676 plug-ins: file-tiff using the new dialog generation. 2020-11-23 02:15:13 +01:00
56bfda3dd3 plug-ins: update file-png to new metadata handling.
The plug-in GUI code keeps slimming down. :-)
2020-11-23 02:15:13 +01:00
3918a0a04c libgimp: new metadata support concept in GimpSaveProcedure and new…
… class GimpSaveProcedureDialog.
The idea is that we have basically the same code in most file format
plug-ins to handle various generic metadata, yet usually with slight
differences here and there. Even behavior is sometimes a bit different
even though there is no reason for the logics to be different from one
format to another.

So I move the metadata support logics into GimpSaveProcedure (and
GimpProcedureConfig still keeps the main export logics). The GUI logics
is now in a new GimpSaveProcedureDialog. So export plug-ins will now get
the creation of generic metadata nearly for free. All they have to do is
to tell what kind of metadata the GimpSaveProcedure supports with the
gimp_save_procedure_set_support_*() functions.

Then consistency will apply:
- If a format supports a given metadata, they will always have an
  auxiliary argument with the same name across plug-ins.
- The label and tooltips will also be always the same in the GUI.
- Order of metadata widgets will also stay consistent.
- The widgets will work the same (no more "Comment" text view missing in
  one plug-in but present in another, or with an entry here, and a text
  view there, and so on).

Also adding gimp_save_procedure_dialog_add_metadata() to allow plug-ins
to "declare" one of their options as a metadata option, and therefore
have it packed within the "Metadata" block which is now created (for
instance for PNG/TIFF/JPEG specific metadata). This allows a nicer
organization of dialogs.
2020-11-23 02:15:13 +01:00
ae4daf9465 Update Polish translation 2020-11-22 13:42:42 +01:00
f9f516a99a libgimpwidgets: fix missing doc comments and annotations. 2020-11-20 11:36:11 +01:00
9f03bdce30 libgimpwidgets: fix the def file. 2020-11-20 10:10:47 +01:00
c58b7ad80b libgimp: mnemonic duplicate verification in GimpProcedureDialog.
A very common issue we have with dialog creation is good mnemonics. In
particular, we want to:
* Keep consistent mnemonics for common features (basically the core
  buttons) common to all plug-in dialogs.
* Have mnemonics for all options.
* Avoid duplicate mnemonics if possible.

Mnemonics are a usability/accessibility feature which can be important
for people using the keyboard a lot (not necessarily only because they
prefer keyboard, but also possibly because of various disorders).

This code will check at runtime that there are no missing or duplicate
mnemonics and simply print to stderr. We don't want to bother overly the
users about these, but we want developers and translators to be aware
about these so that they can easily spot and fix them.
2020-11-20 09:37:26 +01:00
4511de4268 plug-ins: file-tiff dialog now generated too.
72 lines smaller according to git stats. And once again, this is WIP and
may even get smaller with the new ideas I got.
2020-11-20 01:47:18 +01:00
cd0ac72314 libgimp: generated text buffer should also have a tooltip taken from…
… the property blurb.
2020-11-20 01:47:18 +01:00
bc3602a787 libgimpwidgets: new gimp_label_int_widget_get_widget() function. 2020-11-20 01:47:18 +01:00
3128047a0b plug-ins: in metadata editor and viewer only convert values to UTF-8 if they are not.
Certain metadata is already UTF-8. Converting them from locale
to UTF-8 again leads to incorrectly shown strings.
2020-11-19 23:25:27 +00:00
d004305019 plug-ins: fix metadata-editor not saving Xmp.photoshop.Urgency and Xmp.xmpRights.Marked.
The values of Description tab - Copyright Status and IPTC tab - Urgency were not saved.
We are fixing that with this commit. Urgency is also saved to Iptc.Application2.Urgency.
2020-11-19 23:25:27 +00:00
47065df53c plug-ins: let metadata-editor also save Iptc tags. 2020-11-19 23:25:27 +00:00
96c5d1c1a1 plug-ins: add missing Iptc equivalents of Xmp tags in metadata-editor.
Also added a comment to Xmp.photoshop.CaptionWriter which
occurs twice in the list.
2020-11-19 23:25:27 +00:00
7cce45b377 plug-ins: In metadata-editor always read iptc equivalent values of xmp tags.
Iptc equivalent tags of Xmp tags were only read if the Xmp tag had no value
which doesn't make sense since there is no guarantee that they are the same.

We changed this to always read the Iptc tags too and if the value differs
from the Xmp tag we add both values. That way the user can decide
which values are relevant.
2020-11-19 23:25:27 +00:00
879b3745d2 plug-ins: fix not showing all values of iptc tags that appear more than once.
This is one of the problems mentioned in issue #5863. This commit fixes
this problem in the metadata-editor by using gexiv2_metadata_get_tag_multiple.
Empty string values will be skipped.
2020-11-19 23:25:27 +00:00
bd2f43bf20 plug-ins: Refactor cleaning xmp values into a separate function in metadata-editor.
The same code was used several times so we move it to  its own function.
2020-11-19 23:25:27 +00:00
c855590ffa plug-ins: fix incorrect struct used for comparison in metadata-editor. 2020-11-19 23:25:27 +00:00
786aaec2a3 plug-ins: fix incorrect single/multi(ple) values for certain iptc tags used in metadata editor. 2020-11-19 23:25:27 +00:00
26db975a84 plug-ins: fix incorrect reading of iptc tags that appear more than once.
This is one of the problems mentioned in issue #5863. This commit only fixes
this problem in the metadata-viewer.
2020-11-19 23:25:27 +00:00
599d91db54 plug-ins: Refactor certain string handling into separate functions in metadata-viewer. 2020-11-19 23:25:27 +00:00
d0f67faf29 libgimpbase: fix incorrect reading of iptc tags that appear more than once.
This is one of the problems mentioned in issue #5863. This commit only fixes
our loading (and saving) of this metadata.
Certain iptc tags like "Keywords" can appear multiple times. We were using
gexiv2_metadata_get_tag_string to get the value but that always returns
the first value so we replaced that by gexiv2_metadata_get_tag_multiple.
2020-11-19 23:25:27 +00:00
501675b8a3 plug-ins: file-png now uses generated dialog.
Basically the same design as before (but a bit prettier, by using a
2 columns flowbox rather than a grid), yet 80 lines smaller according to
git stats. Also still the exact same code logics as before. No feature
loss (and actually a feature gain as there was the "Save comment"
checkbox but no text field to edit the comment as we get in other
plug-ins).

Basically better and prettier dialog in just a few lines. Moreover it's
still work-in-progress. We can even do better, but this is things to
come.
2020-11-20 00:22:21 +01:00
5fa38d5765 libgimp: bug fixes and design improvements for generated widgets. 2020-11-20 00:06:27 +01:00
bb322d94d7 Fix typos
Found via:
```
codespell -q 3 -S ./ChangeLog*,*.po,./.git,./NEWS* -L als,ang,ba,chello,daa,doubleclick,foto,hist,iff,inport,klass,mut,nd,ower,paeth,params,pard,pevent,sinc,thru,tim,uint
```
2020-11-19 21:56:25 +01:00
0b040dc109 Update Serbian translation 2020-11-18 20:39:29 +00:00
02142e92f7 Update German translation 2020-11-17 16:06:14 +00:00
de91d84906 meson: libjpeg and libtiff are not optional dependencies! 2020-11-17 04:08:15 +01:00
3f59769120 INSTALL: update GEGL build instructions.
Recently updated my distrib, so it's a good time to see what is wrong in
our instructions. In particular, we must build GEGL with Cairo,
otherwise gegl:npd is not built (and it's a mandatory operation for
GIMP).
2020-11-17 03:55:42 +01:00
22534f71b3 Update Ukrainian translation 2020-11-16 18:33:50 +00:00
9a90eefe1f plug-ins: improvement of TIFF loading when TIFFNumberOfDirectories()…
… fails.
My previous commit was just assuming there is one page when the libtiff
function fails. But thinking a bit more on this, there are 2 edge cases
even here:

- If the image is actually really corrupted to the point there are no
  TIFF directories to read.
- If there are actually more available directories. It would be much
  better if GIMP were able to salvage them from a broken file.

To handle these cases, I actually count manually the number of
directories by looping with TIFFSetDirectory() (which still works fine
on our minimal image). I use 65535 as a max value because in libtiff's
TIFFNumberOfDirectories() implementation, it says this is the max value
(even though I couldn't confirm this in the spec; there is a "Number of
Directory Entries" on 2 bytes, but this is about various fields for each
directories, not a number of directories; still anyway this is already a
huge number and since libtiff won't likely be able to handle directories
over this limit, not need to go over either).

I am also adding a test in the end so that we can output an appropriate
message if we actually failed to read any data from the TIFF (whether or
not TIFFNumberOfDirectories() succeeded, when we actually tried to read
the contents, we couldn't).
2020-11-16 16:21:50 +01:00
9ff0204230 Issue #5837: TIFF file not recognized.
On a provided minimal 1×1px TIFF file, TIFFNumberOfDirectories() seems
to choke on some missing field and returns 0. I am not sure if the file
is actually valid or not, but let's make some kind of exception
(outputting a warning of our own when we do) by assuming there is at
least 1 page/image in the file when TIFFNumberOfDirectories() returns 0.

Other than this minimal file (which probably has no other interest than
being a test case), it could actually help salvage corrupted TIFF file
by attempting to read more data.
2020-11-16 15:10:07 +01:00
2a439ba21e NEWS: update. 2020-11-16 11:01:44 +01:00
5d639dcd97 Update Ukrainian translation 2020-11-16 07:24:48 +00:00
9c52af21ea app: better translatable text for "Indexed color" color space text…
… in Image properties window.

Basically using non-translatable "%s (%d %s)" and filling it with
"Indexed color" base type name and translatable _("colors") is very bad
practice (localization-wise):

- First it assumes everyone uses round brackets.
- It also assumes the order of words (number before word it determines
  but even the image type before detail brackets).
- And finally it doesn't handle plurals. Of course, we could say that
  the 1 color case is a very edge impractical case, but plural is not
  only about 1 vs other numbers. Some languages have more cases, and
  using ngettext allows translators to handle these.
2020-11-16 01:04:42 +01:00
b7796b0bfb app: improve sample text logics for CJK fonts.
First of all, "CJK Unified Ideographs" block should not be the highest
priority to determine showing an ideograph. Indeed most fonts for a
Korean and Japanese audience would also contain at least the main
ideographs. So instead, look first for Korean alphabet (Hangul) and
Japanese syllabaries to determine if it's a Korean or Japanese-targetted
font. Only then Chinese.
Also check Korean before Japanese because most of the Korean fonts I saw
actually also include Japanese syllabaries (but not the other way
around).
This way, it will be much easier for CJK graphists to skim through the
font list and detect fonts made for the needed language in a glance.

Also modifying the Korean display text. KIYEOK and SSANGKIYEOK were
obviously chosen because they were the first in the block. But they are
very bad choice. We hesitated with 가 at first, as it is considered the
first in the syllabary form (가나다라 is kind of similar to our ABCD).
But it wouldn't show a form with a second consonant (below) which is a
good stylistic indication. So we hesitated between 한 (han) and 글
(geul, which also means text so it's a nice sample), and finally went
with 한 because of the circle shape in ㅎ (hieut) but also its small
"hat" which has many stylistic variants. So it's quite a good hint of
stylistic choices made by a font designer from just the sample box.

Moreover I switched the block check from "Hangul Jamo" to "Hangul
Syllables" block. "Hangul Jamo" are positional forms of the letters to
dynamically compose syllables (in particular legacy syllables not in use
anymore). Though a feature-full Korean font set would design these, it
is less important than "Hangul Syllables" (pre-composed syllables
design) or "Hangul Compatibility Jamo" (basically the same letters as
"Hangul Jamo" but for standalone usage). Also I actually saw some fonts
made for Korean without "Hangul Syllables" support.

Finally I also added a test for Japanese. I check the Hiragana block
which is most likely the most basic which has to be in any
Japanese-targetted font and use 'あ' (a) as sample text, which is the
first Hiragana syllable and here definitely a good sample text in my
opinion.

I believe that this can still be improved though. Checking only a single
block to determine the probable target language is not necessarily
enough. For instance very complete fonts for Chinese may also design
Korean and Japanese characters, but will also have most CJK blocks and
more ideographs (whereas Japanese/Korean will likely have less). Yet
let's say this is good for now, at least better than before!
2020-11-15 21:55:32 +01:00
b19e7796b2 app: s/pango_fc_font_has_char/pango_font_has_char/ (undeprecation). 2020-11-15 17:25:49 +01:00