Commit Graph

4043 Commits

Author SHA1 Message Date
Michael Natterer 5f8d0ef27b libgimp: add gimp_plug_in_extension_enable() and _extension_process()
Start copying all the actual wire communication to GimpPlugIn, and
move the legacy versions to gimplegacy.c.

This implies having the entire protocol code twice, but without any
if(PLUG_IN) { plug_in_stuff(); } else { legacy_stuff(); }

At the moment it is a wild mixture of old and new, but when finished
the wire code in gimplegacy.c will be entirely separate from the wire
code in GimpPlugIn, which will make it easy to g_assert() that only
one API is used by a plug-in.
2019-08-02 12:02:20 +02:00
Michael Natterer 0bec2bcdec libgimp: add gimp_procedure_set_menu_label() and _set_documentation()
which replace _set_strings(). Add more docs.
2019-08-02 00:56:00 +02:00
Michael Natterer b511cf34cf libgimp: add gimp_procedure_set_attribution()
Also rename "author" to "authors" and add some docs.
2019-08-02 00:35:17 +02:00
Michael Natterer a841e0fb06 libgimp: add gimp_procedure_set_image_types()
and remove the "image_types" parameter from gimp_procedure_set_strings(),
which is only a bad hack copied from the core procedure class.
2019-08-01 23:09:01 +02:00
Michael Natterer e0a6eb38da libgimp: add run_data and run_data_destroy parameters to procedure_new()
so bindings work properly. Change plug-ins accordingly.
2019-08-01 22:45:49 +02:00
Michael Natterer 1c650801e8 plug-ins: follow gimp_procedure_new() API change in goat-exercise 2019-07-30 21:03:34 +02:00
Michael Natterer 1e10cfc53f plug-ins: register an icon for goat-exercise 2019-07-30 19:25:06 +02:00
Michael Natterer 32ea28b6b1 app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
  information needed for constructing all GParamSpecs we use, don't
  use GimpPDBArgType in GPProcInstall but an enum private to the wire
  protocol plus the GParamSpec's GType name. Bump the wire protocol
  version.

- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
  take care of converting between GPParamDef and GParamSpec. They
  share code as far as possible.

- Change pluginrc writing and parsing to re-use GPParamDef and the
  utility functions from gimpgpparamspecs.

- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
  the entire core uses proper GParamSpecs from the wire protocol now,
  the whole file will follow down the drain once we use a GValue
  representation on the wire too.

- In gimp_plug_in_handle_proc_install(), change the "run-mode"
  parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
  already an enum). and change all places in app/ to treat it as an
  enum value.

- plug-ins: fix cml-explorer to register correctly, a typo in
  "run-mode" was never noticed until now.

- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
  between old-style wire communication and using GParamSpec and
  GValue, it contains some functions that are subject to change or
  even removal in the next steps.

- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
  able to actually install procedures the new way.

- plug-ins: change goat-exercise to completely use the new GimpPlugIn
  and GimpProcedure API, look here to see how plug-ins will look in
  the future, of course subject to change until this is finished.

- Next: changing GPParam to transmit all information about a GValue.
2019-07-28 17:34:40 +02:00
Federico Mena Quintero 16660c5928 file-svg: Use rsvg_handle_new_from_gfile_sync() instead of GIOChannel
The latter is obsolete, and rsvg_handle_write()/close() are deprecated
anyway.
2019-07-22 17:26:22 -05:00
Federico Mena Quintero b2027c40b7 Issue #2561: Fix computation of SVG image sizes
The librsvg API was being called in an incorrect order.  One cannot
call rsvg_handle_get_dimensions() until after rsvg_handle_close() is
done.
2019-07-22 17:26:22 -05:00
Michael Natterer 6bb03dc21a plug-ins: revive animation-play, and draw stuff with cairo
Still lots of deprecated stuff, but mostly GtkAction and friends.
2019-07-22 17:28:20 +02:00
Jehan ef3c13c6c5 plug-ins: use global gegl_init() in file-pdf-load run() function.
As noted by Mitch, this is simpler and what we do in other plug-ins.
2019-07-22 14:56:04 +02:00
Jehan 443c171f8d plug-ins: babl_init|exit() for non-interactive "file-pdf-load" too.
Improve my previous commit: I added babl_init|exit() for
"file-pdf-load-thumb". But these was actually also missing from
non-interactive calls to "file-pdf-load", since the initialization was
done as part of gimp_ui_init() so far.
Just run them down the call stack around the needed part. It's not a
problem if it's called double (for the interactive code path).
2019-07-22 12:39:45 +02:00
Michael Natterer f4b88c0a9e plug-ins: link file-pdf against GEGL/babl 2019-07-22 12:19:07 +02:00
Jehan e0a24a27de plug-ins: babl_init|exit() needs to be run for "file-pdf-load-thumb".
This is run as part of gimp_ui_init() in the normal "file-pdf-load"
calls, but such calls have been forgotten for the thumbnail load
procedure.

Also the GimpRunMode is only a parameter in "file-pdf-load". For
"file-pdf-load-thumb", the first parameter is directly the filename. The
fact it might have used to work is chance as it were only tested against
GIMP_RUN_INTERACTIVE, which is 0, so the test would end up FALSE, which
is what we want for thumbnail loading. Anyway now we get a proper call
(thumbnail loading always considered non-interactive).
2019-07-22 12:13:38 +02:00
Michael Natterer 7208fba663 plug-ins: don't use deprecated icon API in compose 2019-07-22 00:05:46 +02:00
Michael Natterer 82cdd69e0c plug-ins: completely undeprecate curve-bend 2019-07-21 21:23:28 +02:00
Michael Natterer 98f9205faa plug-ins: completely undeprecate sample-colorize 2019-07-21 20:56:07 +02:00
Michael Natterer 23f373e916 plug-ins: remove filter-pack without any replacement 2019-07-19 19:01:51 +02:00
Michael Natterer b7cf850671 plug-ins: remove the oilify plug-in and add a PDB compat procedure 2019-07-19 17:35:13 +02:00
Michael Natterer d944a7b9a4 plug-ins: port warp to GEGL, stupid 8-bit port only
And put it back in the menus, it's just too weird not to have.
2019-07-19 13:10:42 +02:00
Michael Natterer 8a51993e3f pdb, plug-ins: remove the emboss plug-in and add a PDB compat procedure
Not for 2.10 because it looks a bit different.
2019-07-18 15:05:48 +02:00
Michael Natterer 31fc338ab0 pdb, plug-ins: remove the newsprint plug-in and add a PDB compat procedure 2019-07-18 12:52:18 +02:00
Jehan fb3007edef plug-ins: get rid of babl_format() in file-heif too. 2019-07-17 14:21:23 +02:00
Jehan 74abdfa377 plug-ins: improve a bit the space invasion code.
No need to call babl_format() to then use the encoding part only with
babl_format_get_encoding(). Just keep the encoding as constant string
and use it on babl_format_with_space() at the end.

This doesn't actually change the logics, but make code a bit simpler,
and also remove calls to babl_format(), which makes discovering non
space-invaded code with grep-s easier.
2019-07-17 12:46:00 +02:00
Michael Natterer 7cd78f436d plug-ins: port depth-merge to GEGL, stupid 8-bit port only 2019-07-17 12:18:50 +02:00
Michael Natterer 4c1677078e plug-ins: port van-gogh-lic to GEGL
Special effects that nobody understands, now in floating point.
2019-07-17 01:03:48 +02:00
Michael Natterer fd9b6ab834 plug-ins: remove the colorify plug-in without any replacement
The colorize tool does something far more reasonable.
2019-07-15 12:33:50 +02:00
Michael Natterer 9d33a9a9ca plug-ins: port animation-optimize to GEGL, stupid 8-bit port only 2019-07-15 12:24:24 +02:00
Michael Natterer acea533a9a plug-ins: remove the sharpen plug-in without replacement 2019-07-15 00:39:01 +02:00
Michael Natterer 496b5ab9b4 plug-ins: remove color-cube-analyze without replacement
because WTF do we need a histogram plug-in for?
2019-07-14 23:45:57 +02:00
Michael Natterer 4074cec138 plug-ins: remove the blur plug-in without replacement
because.
2019-07-14 23:31:58 +02:00
Michael Natterer dd89f4a3d5 plug-ins: remove the max-rgb plug-in without replacement
To quote the author (from a comment): "After adding preview mode
realised just exactly how useless this plugin is"
2019-07-14 23:08:12 +02:00
Michael Natterer 2ead56096d plug-ins, pdb: remove the softglow plug-in and add a PDB compat procedure
Not for 2.10 because the GEGL op's result looks different. I have no
clue how softglow is supposed to look at all, but the removed plug-in
did things that can't possibly be done with physical light in a
darkroom, so chances are the GEGL op is more correct.
2019-07-14 21:34:27 +02:00
Michael Natterer a0ae31d337 plug-ins, pdb: remove the edge-dog plug-in and add a PDB compat procedure
This is not for 2.10 because the result of the GEGL op looks different,
but without doubt more correct.
2019-07-14 20:09:11 +02:00
Michael Natterer 8fcccf3f88 plug-ins, pdb: remove the contrast-normalize plug-in
and add a PDB compat procedure.
2019-07-14 14:28:40 +02:00
Michael Natterer 8b08f958ba plug-ins, pdb: remove the edge-neon plug-in and add a PDB compat procedure 2019-07-13 23:59:31 +02:00
Michael Natterer 98be067874 plug-ins: port destripe to GEGL, stupid 8-bit port only 2019-07-13 12:47:45 +02:00
Michael Natterer f9e149dc1e plug-ins: port cml-explorer to GEGL, stupid 8-bit port only 2019-07-13 00:24:52 +02:00
Jehan 6d4a11a261 plug-ins: properly free return values of gimp_image_get_layers()...
... and gimp_item_get_children().
I know plug-ins are shortlived. Still I don't like this!
2019-07-12 13:11:47 +02:00
Michael Natterer 075b34baea plug-ins: port sparkle to GEGL, stupid 8-bit port only 2019-07-12 13:05:38 +02:00
Jehan 5b2d89f794 plug-ins: clean up a bit file-pdf-save.
This improves commit bbd5ebbe8a. Several parameters did not need to go
inside draw_layer(). In particular this function should not take care of
filling return values on errors. It should just return a success boolean
with a GError which is processed on the main function. This also allows
proper shortcut to end the loop earlier on the first error.
Also the layer index parameter does not need to be a pointer since it
never requires updates.
Finally declare variables in smaller scopes for cleaner code.
2019-07-12 00:02:34 +02:00
Lionel bbd5ebbe8a Issue #1002: Fix for layer groups in PDF export
Added a recursive loop to draw layer children in layer groups. Text
layers in layer groups are now exported correctly.
2019-07-11 23:34:03 +02:00
Michael Natterer 32a229b049 plug-ins: hot's dest_buffer can have another format than src_buffer 2019-07-11 16:18:21 +02:00
Michael Natterer bad956cb1f plug-ins: port hot to GEGL, stupid 8-bit port only 2019-07-11 15:08:44 +02:00
Michael Natterer ceb327f357 plug-ins, pdb: remove the photocopy plug-in and add a PDB compat procedure
The results are different here too, but tweakable like for cartoon.
2019-07-11 12:33:56 +02:00
Michael Natterer 0e23d7262b plug-ins: port contrast-retinex to GEGL, stupid 8-bit port only 2019-07-11 12:17:01 +02:00
Michael Natterer 529ee9efc8 plug-ins, pdb: remove the cartoon plug-in and add a PDB compat procedure
The result of the GEGL op is a bitt different but so what, this is an
artistic effect and the result can be tweaked with parameters.
2019-07-11 11:41:06 +02:00
Michael Natterer 0188853b23 plug-ins: port sphere-designer to GEGL, stupid 8-bit port only 2019-07-11 10:39:13 +02:00
Michael Natterer c59feead89 plug-ins: port despeckle to GEGL, stupid 8-bit port only 2019-07-10 15:40:20 +02:00
Michael Natterer 0326a3e79a plug-ins: port grid to GEGL, stupid 8-bit port only 2019-07-10 12:43:27 +02:00
Michael Natterer bbcc7ca5f5 Issue #3630 - postscript plugin crashes
gsapi_new_instance() now expects a pointer to a NULL-initialized
pointer. Initialize "void *instance" with NULL. Found by massimo.
2019-07-09 15:36:13 +02:00
Michael Natterer 2a54b1b41c plug-ins: forgot one deprecated call in sample-colorize 2019-07-09 13:17:31 +02:00
Michael Natterer df7699b814 plug-ins: port sample-colorize to GEGL, stupid 8-bit port only 2019-07-09 13:15:12 +02:00
Michael Natterer 0b4b8d75ea plug-ins: port curve-bend to GEGL, stupid 8-bit port only 2019-07-08 21:23:03 +02:00
Michael Natterer 8ac6ec2a00 plug-ins: a ton of cleanup in curve-bend
- move use of deprecated function to very few places
- indentation, formatting
- fix insane variable names, it's now much more readable
2019-07-08 21:05:49 +02:00
Michael Natterer 069d4345bb plug-ins: port tile-small to GEGL, stupid 8-bit port only
...GimpPixelFetcher use down to one!
2019-07-07 18:34:54 +02:00
Michael Natterer c6934a67e7 plug-ins: tile-small was still using "expose-event", port to "draw" 2019-07-07 17:57:14 +02:00
Michael Natterer 775abb03f3 plug-ins: replace calls to GimpRegionIterator functions
by plain pixel region code, copied right out of gimpregioniterator.c.
Makes porting to GEGL easier and GimpRegionIterator unused.
2019-07-07 17:09:17 +02:00
Michael Natterer 8f621ec91d plug-ins: port checkerboard to GEGL, stupid 8-bit port only
just for the sake of not using "Psychobilly", hello pippin :)
2019-07-07 16:04:07 +02:00
Michael Natterer 96e7a791f8 plug-ins: some WIP undeprecating curve-bend
better push before it rots... totally unfinished but works.
2019-07-06 13:11:41 +02:00
Michael Natterer 738c035839 plug-ins: fix two harmless compiler warnings 2019-07-02 15:22:52 +02:00
Jehan f4af95ab95 plug-ins: some cleaning in HEIF plug-in.
heif_chroma_interleaved_24|32bit are deprecated values replaced by
heif_chroma_interleaved_RGB(A).

Also we allocated a HEIF context twice (i.e. leaking it).

Finally it's better to initialize heif_image and heif_encoder variables
to NULL because these may not be set if creation functions fail (and
it's better to fail with NULL than with garbled unset contents).
2019-07-01 19:28:43 +02:00
Jehan 7f76430090 plug-ins: improve a bit HEIF export dialog.
- Add the quality slider in a frame under the "lossless" checkbox,
  making the relationship more obvious.
- Make the whole frame contents insensitive when "lossless" is checked
  and not just the slider. Once again, it makes the relationship more
  obvious.
- Add a mnemonic to the "Lossless" checkbox and "Quality" slider.
2019-07-01 16:57:22 +02:00
Jehan dfd79ad79b plug-ins: add a "Save color profile" checkbox in HEIF export. 2019-07-01 16:39:13 +02:00
Jehan 5d6baf5f85 plug-ins: implement our profile export policy for HEIF.
Same as WebP or jpeg: follow explicitly assigned profile TRC; convert
default (non-assigned) profile to sRGB, except if work format is 8-bit
linear.
2019-07-01 15:36:59 +02:00
Jehan 1370112ac2 plug-ins: improved space invasion in HEIF export. 2019-07-01 00:35:49 +02:00
Michael Natterer 267d925025 plug-ins: port nl-filter to GEGL, 8 bit only 2019-06-28 19:25:31 +02:00
Michael Natterer c1f2973232 plug-ins: port film to GEGL 2019-06-28 18:40:41 +02:00
Jehan 1a1623784f plug-ins: plug-ins: get space from the profile in PNG export too. 2019-06-27 16:20:53 +02:00
Michael Natterer 4c7a43d234 plug-ins: replace gimp_drawable_get_color_uchar() by manual code 2019-06-27 13:37:04 +02:00
Michael Natterer 4c4abf7fc4 plug-ins: port blinds to GEGL
Found another unfinished result of boredom from years ago.
Stupid 8-bit only port.
2019-06-27 13:23:31 +02:00
Michael Natterer 57ac8cfa7e plug-ins: port jigsaw to GEGL
Found in my stashes, I have no idea why I even bothered but it just
needed a minor fix to work, so here we go. Stupid port that always
uses 8 bit and kills higher bit depths.
2019-06-26 17:26:53 +02:00
Michael Natterer 06e0ca8ef0 plug-ins: fix comment typo in file-png 2019-06-26 17:26:06 +02:00
Michael Natterer c356564984 plug-ins: space invade file-heif
Use the drawable's space for the load/save formats, to avoid unwanted
color conversions.
2019-06-25 13:53:44 +02:00
Michael Natterer 62f010df90 configure.ac, plug-ins: make file-heif build with older libheif again
Lower requirement to 1.3.2 and check for 1.4.0 separately. Put color
profile code in #ifdef HAVE_LIBHEIF_1_4_0.
2019-06-25 13:20:07 +02:00
Michael Natterer a08293dc74 Issue #3532 - Wrong color profile on nikon taken photos, it's...
...always AdobeRGB!

Change all file plug-ins to never call gimp_image_metadata_load_finish()
with the GIMP_METADATA_LOAD_COLORSPACE when they loaded a color profile.

This keeps gimp_image_metadata_load_finish() from assigning a profile
from DCT even if the loaded profile was GIMP's built-in sRGB.
2019-06-20 18:08:59 +02:00
Michael Natterer 6740c0af92 Issue #3264 - Wrong colors from opening and exporting non-sRGB tiffs...
...and pngs

Fix PNG import and export:

When importing, set the color profile on the image *before* creating
the layer, so its buffer has the right format with space.

When exporting, create the saving babl format with the layer's space
so no color conversion happens when reading the layer's pixels.
2019-06-16 14:52:48 +02:00
Jehan 24ed5870ad plug-ins: PNG export TRC chosen similarly to TIFF.
While we tend to default to sRGB for 8-bit max formats (such as JPEG or
WebP) when no explicitly-assigned profile was set, there is no need to
do so for PNG too. Indeed since we have the ability to export 16-bit
PNG, let's consider this is ok to export 16-bit linear data when writing
GIMP's default linear profile.

Moreover let's follow the profile's (fallback to storage's) TRC also
when exporting to a specific precision (as chosen manually in the
dialog), not only when sticking to "Automatic", unless we are downsizing
a high bit depth work image to 8-bit without a manually assigned profile
(the only case we forcefully export as sRGB data, hence convert the
profile if linear storage).
2019-06-07 18:49:18 +02:00
Michael Natterer 0710051e2b app, plug-ins: make sure a GIH brush's spacing is preserved
across load and save, by introducing a gimp-brush-pipe-spacing
parasite.
2019-05-28 00:25:47 +02:00
Jehan cf37d1ae56 plug-ins: follow the assigned profile TRC in PNG export.
Similar to JPEG export (commit c5f7bac2ba)
as discussed with Ell. GIMP should follow and save as-is any *assigned*
profile. We only make a decision about whether to convert from storage
precision to another format when the profile is the default GIMP one.

Picked from commit 72c5d24fe9.
Some changes may have to happen later on the master code as the space
invasion changes a bit how default profiles are handled.
2019-05-26 14:17:41 +02:00
Jehan c5fae74ac1 Issue #3193: Wrong colors after exporting 8bpc RGB png from 32f...
... linear XCF.
When choosing a specific pixel format (other than "Automatic"), we
always export as non-linear. Therefore if we were going to save a linear
profile, make sure we also convert it to sRGB too.
2019-04-12 14:33:19 +02:00
Jehan b1133ef866 plug-ins: updating deprecated enum names from libheif. 2019-04-01 15:38:27 +02:00
Jehan 22e14e0b9b Issue #3164: HEIC doesnt have color profile.
Since this requires libheif 1.4.0, released end of February 2019, this
commit should not go into the gimp-2-10 branch right now.
2019-04-01 15:29:58 +02:00
Ell 8954d1f386 libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:28:52 -05:00
Jehan 3384bdf6bc Issue #1256: Import damages colormap numbering.
Do not remove fully transparent colors from the PNG palette.

(cherry picked from commit 7812aced5d)
2019-03-08 15:18:44 +01:00
Michael Natterer cc7e07fecb app, plug-ins: move brush pipe saving from the file-gih plug-in to the core
As with .gbr and .pat, only the actual saving code, not the export
logic and GUI.
2019-03-03 19:56:04 +01:00
Ell 11defa4271 Issue #2997 - Error importing PCX
Commit dc069e424a removed the
assumption that 1-bpp PCX files are B&W, in favor of using the
provided palette, which is (supposedly?) the correct behavior.
However, there are evidently B&W files that do not specify a
palette, resulting in an all-black image (i.e., a 2-color indexed
image, whose both palette entries are black).  Since other
software, including older versions of GIMP, load such files
"correctly", let's fix this by falling back to a B&W palette when
the provded palette is uniform.
2019-02-22 12:02:09 -05:00
Michael Natterer 52adaa1963 app, plug-ins: move file-gih-load from the file-gih plug-in to the core 2019-02-19 23:41:34 +01:00
Michael Natterer 90164c4951 app, plug-ins: move brush (gbr) saving to the core
just the export logic remains in the plug-in, just as for patterns.
2019-02-16 19:01:33 +01:00
Michael Natterer b71ebcea6d plug-ins: forward the error message if file-pat-save-internal fails 2019-02-16 18:59:01 +01:00
Michael Natterer 52b1348f3d plug-ins: remove stuff that is no longer needed from file-pat 2019-02-12 21:38:22 +01:00
Michael Natterer b29ecfb5da app, plug-ins: move pattern saving to the core
but only the actual saving code, not the export magic and dialog.

Add new internal procedure file-pat-save-internal which is not
registered as a file procedure and always works non-interactively on
the passed arguments and only saves the passed drawable. Use the new
internal procedure from the file-pat-save code and remove all file
writing code from the plug-in.

This way all pattern file writing code duplication is killed, while
the whole export mechanism is completely unchanged.
2019-02-12 21:27:13 +01:00
Michael Natterer 410ffc435e app: move file-pat-load from the file-pat plug-in to the core 2019-02-11 18:35:07 +01:00
Michael Natterer a4e77e57f6 app, plug-ins: start consolidating brush and pattern loading/saving code
We currently have brush and pattern I/O code in both the core and
plug-ins. This commit starts removing plug-in code in favor of having
one copy of the code in the core, much like XCF loading and saving is
implemented.

Add app/file-data/ module with file procedure registering code, for
now just with an implementation of file-gbr-load.

Remove the file-gbr-load code from the file-gbr plug-in.
2019-02-11 12:51:31 +01:00
sabri ünal 43fb9242ca Typo 2019-01-24 22:11:31 +00:00
Michael Natterer 5fffadba54 Issue #1793 - Move Guillotine tool to a different position in menus...
...(and rename it)

Move it into the "Crop" group of the image menu and call it "Slice
Using Guides".
2019-01-05 14:56:24 +01:00
Michael Natterer 08a31a01f8 plug-ins: set a minimum height on the unit editor's scrolled window 2019-01-05 14:15:01 +01:00
Jehan a89e503054 Issue #2611: Cannot open certain .pdf files in GIMP.
I am unsure of the problem, but it is fixed by using
poppler_document_new_from_gfile() instead of giving the contents of a
GMappedFile to poppler_document_new_from_data().
Using GFile is anyway usually prefered so I don't dig up more and just
make this change.
2019-01-02 22:54:21 +01:00
Michael Natterer 74c9d835e8 Issue #2617 - Export to C image artifacts
As correctly spotted by Royce Pipkins, the buffer for the drawable's
pixel lines was too small.

Also fix the plug-in to hardcode "R'G'B'[A] u8" so it won't misbehave
on high bit-depth images, and make it work on all sorts of drawables,
not only "RGB*" (it will still always export RGB images).
2019-01-02 21:28:24 +01:00