Commit Graph

4235 Commits

Author SHA1 Message Date
Jacob Boerema 19b261f3c6 plug-ins: add most likely blend modes for certain psp blend modes.
This adds a blend mode for all known psp blend modes that were not
converted yet except for adjust.
I couldn't find any information about adjust and it's value of
255 suggests that it is not a normal blend mode.
2020-08-31 12:28:12 +00:00
Jacob Boerema b968a93ab2 plug-ins: fix reading of psp tubes when psp file version >= 4. 2020-08-31 11:10:15 +00:00
Jehan 97dc1bf9c6 plug-ins: fix wrong return type warning.
save_image() returns a boolean not a pointer.
2020-08-31 12:52:23 +02:00
Jacob Boerema fa40bc7778 plug-ins: add support for reading raster layers of newer psp versions. 2020-08-27 09:16:45 +00:00
Jacob Boerema 85241a205b plug-ins: enable reading of psp images with file versions > 6. 2020-08-27 09:16:45 +00:00
Jacob Boerema 0666f7a4f9 plug-ins: refactor reading of raster layer extension info for psp images. 2020-08-27 09:16:45 +00:00
Daniel Novomesky 01e1587ec1 Updated HEIF plug-in
AVIF import and export (need libheif >= 1.8.0)
High bit (10/12) import and export
Auto pre-select suggested output bit depth in save_dialog
NCLX color profile import (link with lcms)
Metadata import (link with gexiv2)
Plugin will not return GIMP_PDB_SUCCESS in case of failure to import file.
2020-08-26 10:39:58 +00:00
Jacob Boerema d7089c93b2 plug-ins: Take zero length layer names into account in psp reader. 2020-08-23 18:34:22 -04:00
Jacob Boerema 4ac373e84f plug-ins: fix reading layer names with high bit ASCII characters in psp files.
This also adds a few missing g_free when returning because of an error.
2020-08-22 21:11:01 +00:00
Jacob Boerema dc80c78a26 plug-ins: fix wrong layer offset of psp layers. 2020-08-22 10:54:39 -04:00
Jacob Boerema 15ad952288 plug-ins: improve psp image reader stability by always using the block/chunk length.
Starting from psp file version 4 the specification recommends to always use the
block/chunk length to determine the next part of the image. This way it is
possible to skip parts you don't know or don't care about or additions in
newer versions.
This change makes sure to always do this which fixes reading several images
which crashed the plug-in before.

Also only try to read layer data if it is a raster layer.
2020-08-18 16:00:50 -04:00
Jacob Boerema f4088adefa plug-ins: fix incorrect loading of PSP images with uncompressed channel data.
According to the PSP specifications "Each scanline in the image data is stored on a 4 byte boundary.	"
Based on all actual images I've seen this is incorrect. Possibly it is a leftover from an older specification.
2020-08-08 08:47:45 +00:00
Jacob Boerema fcb9de07f6 plug-ins: fix reading of creator block data of PSP images.
Since string data in PSP images is not zero terminated
reading creator block data always failed.
2020-08-08 07:53:44 +00:00
Jehan 1a7a53dc09 plug-ins: fix argument description. 2020-07-20 17:38:16 +02:00
Yuri Chornoivan 4510e75864 Fix minor typo: entred -> entered 2020-06-18 09:09:55 +00:00
Michael Natterer 45ce68fe15 plug-ins: change the "compose-type" default values to upper case
just for consistency.
2020-06-17 21:56:31 +02:00
Michael Natterer 4e9227e5d3 plug-ins: make sure "decompose-type" in decompose.c is upperacse
because the string combo box in the dialog is case sensitive.
2020-06-17 21:56:31 +02:00
Michael Natterer 54b5faeefb plug-ins: port file-xmc.c to GimpProcedureConfig and prop widgets 2020-06-17 21:56:31 +02:00
Michael Natterer 0d56bbb745 plug-ins: change "comment" arguments to "gimp-comment"
so they continue to be handled automatically.
2020-06-17 21:56:31 +02:00
Michael Natterer b070abe5bf plug-ins: port decompose to GimpProcedureConfig 2020-06-08 22:59:04 +02:00
Michael Schumacher 8bf8eb9dc0 plug-ins: use G_GOFFSET_FORMAT to fix a long int vs. long long int format warning 2020-05-26 12:12:10 +02:00
Jehan 5498adf50a app, libgimp, pdb: color picker multi-layer aware.
Color picking on a single layer still works as it used to. On multiple
layer, it will now pick on the composited color, similarly to sample
merged if only selected layers were made visible.

The PDB/libgimp function gimp_image_pick_color() is also updated to work
on multiple drawables too, giving the same ability to plug-ins (the only
call to this function in core plug-ins have been updated).
2020-05-17 18:57:32 +02:00
Jehan 98603c69c9 app, libgimp, pdb: "edit-copy" multi-layer aware.
When several layers are selected, select their render, similar to how
"edit-copy-visible" would have copied an image with only these layers
made visible.
Also apply the same logics to PDB function gimp_edit_copy() which can
now be used on several drawables at once.
2020-05-17 18:57:32 +02:00
Jehan d3139e0f7c app: support saving/exporting with multi-selection.
This commit just changes our saving API (i.e. the GimpSaveProcedure
class) to take an array of drawables as argument instead of a single
drawable.

It actually doesn't matter much for exporting as the whole API seems
more or less bogus there and all formats plug-ins mostly care only
whether they will merge/flatten all visible layers (the selected ones
don't really matter) or if the format supports layers of some sort. It
may be worth later strengthening a bit this whole logics, and maybe
allow partial exports for instance.

As for saving, it was not even looking at the passed GimpDrawable either
and was simply re-querying the active layer anyway.
Note that I don't implement the multi-selection saving in XCF yet in
this commit. I only updated the API. The reason is that the current
commit won't be backportable to gimp-2-10 because it is an API break. On
the other hand, the code to save multi-selection can still be backported
even though the save() API will only pass a single drawable (as I said
anyway, this argument was mostly bogus until now, hence it doesn't
matter much for 2.10 logics).
2020-05-17 18:32:16 +02:00
luz.paz 36f620012d Fix typos
Found via codespell v1.17.0.dev0  
```
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-05-04 08:55:48 -04:00
Michael Natterer f3f8d3a54e Issue #3405 - Color component decompose crash for CMY
Remove the "CMY" model from compose and decompose, it's gone from
babl. Also fix decomposing to CMYK by using the right component names.
2020-05-02 21:17:20 +02:00
Jehan fddaa77218 plug-ins: fix abs() on long int.
Fixes the following bug:

> warning: absolute value function ‘abs’ given an argument of type
> ‘glong’ {aka ‘long int’} but has parameter of type ‘int’ which may
> cause truncation of value [-Wabsolute-value]
2020-04-13 23:18:19 +02:00
Jehan b71754f2a7 plug-ins: fix some build warning.
Fixes:
> warning: using integer absolute value function ‘abs’ when argument is of floating point type ‘double’ [-Wabsolute-value]
2020-04-13 21:54:09 +02:00
Jehan 809e79f37a Issue #4919: PDF: Order of pages reversed when opening and closing.
Let's go with the logics "bottom layer is first", which is also the
logics in animated formats. Hence changing the layer order on loading
multi-page PDF.
2020-04-08 20:08:00 +02:00
Jehan 105c4efc8b Issue #4487: change "Save color values from transparent pixels"…
… defaults to FALSE for PNG, TIFF.
The logics is that in most case, when alpha is 0, you don't expect color
to be retrieved and some people were bothered by this when erasing data
with eraser tool or selection deletion.

For the WIP image as well as for XCF format, we definitely want to keep
color data as there are workflows where you would want to erase/unerase
pixels subtly (selection also are not binary and should not be expected
to erase color data on layers with alpha channel). So we want to keep
the non-destructive behavior there.
Yet for export formats, going for "deleting what looks deleted" is a
valid approach, especially as it has been argued that experienced users
would know how to read and change the format options (and these
experienced users are likely the ones who may have valid reasons to want
pixels with full transparency to keep color values).
PNG and TIFF were the only 2 formats where I see such options, so
changing the default for these 2 plug-ins.
2020-04-03 20:04:26 +02:00
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
Jehan ec9dbd8115 libgimpwidgets, app, plug-ins: fix last GIR warnings.
gimp_int_radio_group_new() was still complaining about the scope of
radio_button_callback(). Make it (scope notified) because it needs to
stay alive after the function returns and may be called multiple times.

Also adding a GDestroyNotify to free the callback data once the widget
is destroyed (additionally it will also serve as a notifier for bindings
to properly free the callback closure itself, not only it's data).

With this last one done, GObject Introspection generation now happens
without any warning output.
2020-01-15 14:00:19 +01:00
Cyril Richard 38cccaac49 Issue #4203 - Wavelet decomposition only on RGB images
Add GRAY* to the list of supported image types.
2020-01-06 19:47:44 +01:00
Jehan 24a0b0c53a plug-ins: also omit hidden layer groups in PDF export.
When the "Omit hidden layers and layers with zero opacity" option is
set, this property was only checked on non-group layers. So if we had
non-hidden layers inside hidden layer groups, they ended up exported,
which is not the expected behavior.

See https://gitlab.gnome.org/GNOME/gimp/issues/4425#note_675350
2020-01-01 18:40:52 +01:00
Jehan 34f05750d0 plug-ins: forgot to look missing font duplicates recursively.
Fix for the previous commit, fixes cases with text layers inside groups.
2020-01-01 18:28:04 +01:00
Jehan 1b06067164 Issue #4425: Saving to PDF changes text's font and size.
Adds a new PDF export option "Convert text layers to image", which
defaults to FALSE (because text staying text is obviously usually
prefered).
Also loop through text layers to detect missing fonts. In case any are
found, add a warning in the export dialog, below the new option,
advising to enable this option if design matters (if fonts are missing,
PangoCairo seems to select any other random font and embed it into the
PDF instead of the expected one).
2020-01-01 17:53:02 +01:00
lillolollo 4b07c62cbc Issue #4338 Plug-in file-header exporting to format C header wrong output.
(cherry picked from commit 3f76d7782a)
2019-12-29 23:03:49 +01:00
Jehan 9a4d1f0277 Issue #4209: Animation optimize for GIF moves layers to top left corner.
Regression from commit 9d33a9a9ca as spotted by Massimo.
2019-11-24 21:56:34 +01:00
Michael Natterer 24cadf8589 plug-ins: port file-mng-save to GimpProcedureConfig and propwidgets
and some cleanup, this is one half-finished mess, but at least
now a ported mess.
2019-11-12 01:36:56 +01:00
Michael Natterer 79df3dd1e3 plug-ins: port file-pnm-save to GimpProcedureConfig
and clean up export type selection by introducing an enum.
2019-11-08 10:15:02 +01:00
Michael Natterer a5cf3e9506 plug-ins: port file-gif-save to begin_export() and end_export()
and build its GUI using propwidgets. Remove a lot of code that
is now handled by GimpProcedureConfig, and remove the ui file.
2019-10-29 22:10:59 +01:00
Michael Natterer dad65000e1 plug-ins: port file-raw-save to GimpProcedureConfig and propwidgets
and remove its builder file.
2019-10-23 19:08:34 +02:00
Michael Natterer ba77ce58c7 plug-ins: use begin_export() and end_export() in file-xbm
so the "gimp-comment" parasite is handled automatically.
2019-10-23 19:08:34 +02:00
Michael Natterer c25778c882 plug-ins: use begin_export()/end_export() in file-csource
and remove all manual "gimp-comment" parasite code.
2019-10-23 19:08:34 +02:00
Michael Natterer e21f78e577 plug-ins: add an aux "comment" argument to file-png-save
which is now automatically synced with the image's "gimp-comment"
parasite.
2019-10-23 19:08:33 +02:00
Sabri Ünal 0f8b9ed4aa CID 228155: Resource leak in file-tga.c
Variable fp going out of scope leaks the storage it points to.

(cherry picked from commit e6b0b992df)
2019-10-20 00:30:00 +02:00
Sabri Ünal da6c2f890c CID 227971: Resource leak
Leaked storage: Variable infile going out of scope leaks the storage it points to

Discovered by Coverity Scan.

(cherry picked from commit 477c9458ab)
2019-10-19 23:56:30 +02:00
Sabri Ünal 6dcdbf652b CID 228166: Resource leak in file-raw-data.c
Overwriting fp in fp = fopen(newfile, "wb") leaks the storage that fp points to.

(cherry picked from commit 31001d9f29)
2019-10-19 23:30:28 +02:00
Michael Natterer 9326f4a76c plug-ins: rename all boolean comment arguments to "save-comment"
and let them default to gimp_export_comment(). Set the default value
of all "comment" arguments to gimp_get_default_comment().
2019-10-10 01:32:28 +02:00
Michael Natterer b5f10b6eda plug-ins: port file-heif and file-webp to the new export stuff 2019-10-09 23:50:14 +02:00