Commit Graph

8743 Commits

Author SHA1 Message Date
Jehan 291af71e95 plug-ins: do not use strcpy() when src and dest overlap.
I don't reproduce these build warnings in my build but frogonia reported
them:

> warning: 'strcpy' accessing 1 byte at offsets 0 and [0, 2147483645] may overlap 1 byte at offset 0 [-Wrestrict]

And indeed the man of strcpy() clearly states that "The strings may not
overlap" (which is clearly not guaranted in current code as we don't
know the size of what's after the substring).
strncpy() might have done the trick as it doesn't say anything about
possible overlap or not, but let's just use memmove() instead where it
is clearly written that memory areas may overlap (note that bcopy() as
proposed by ankh would have also done the trick, but it is marked as
deprecated).
2020-04-04 00:48:36 +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 3a0af1f50a Issue #4618: support Canon CR3.
And by "supporting CR3", I mean sending the file over to raw developer
software which are supposed to support it! At the very least RawTherapee
support CR3 (since recent version 5.8 apparently), not sure about
darktable (but if not yet, I assume it won't be long either).
2020-03-14 23:56:45 +01:00
Ell 0ce993c4b9 Issue #4663 - "Error loading PSD file: No error" while trying to open a PSD
In file-psd, avoid error on load when encountering an uknown image
resource of size 0.
2020-02-28 00:47:49 +02:00
Ell be7cace74e plug-ins: in file-psd, make offset/size fields unsigned
In file-psd, make the data_start and data_len fields of the
PSDimageres and PSDlayerres structs unsigned, to avoid potential
overflow/sign-extension.
2020-02-28 00:47:48 +02:00
Ell 1b6191d176 plug-ins: in file-psd, use scratch allocator for temporary CMYK buffers; cleanup 2020-02-22 18:20:53 +02:00
Øyvind Kolås 1462a91d86 plug-ins: Convert CMYK u8 .psd to R'G'B' float on load
Patch from Massimo Valentini in issue #354, adapted for the new object
based plug-in APIs.
2020-02-21 12:29:50 +01:00
Ell 52f5a9f654 plug-ins: improve PSD loading speed
In file-psd, improve loading speed, mostly by eliminating excessive
copies.
2020-02-18 19:17:38 +02:00
Ell 15438c58d2 Issue #4627 - memory corruption when open crafted sgi
In the file-sgi plug-in, check for failure when allocating buffers
of user-controlled size.
2020-02-17 17:01:25 +02:00
Ell 2ed889394d plug-ins: in file-sgi, convert tabs to spaces 2020-02-17 17:01:25 +02:00
Ell 4fe8217898 plug-ins: in screenshot, keep image dirty; keep history clean
In the screenshot plug-in, don't clean the image, since it's not
backed by any persistent source, and disable undo while modifying
it, so that the initial edit history is clean.
2020-02-16 23:05:12 +02:00
Nikc M 0a5af889f9 Issue #175 - Allow the erase every other row plugin to skip a different number of rows
Adds generalized erase Nth row function,
and sets original erase row function to
call generalized one with n = 2
to reduce code duplication
2020-02-13 01:18:22 +02:00
Oleksii Samorukov cfcf38e119 plug-ins/screenshot: fix compilation on macOS 2020-01-17 11:40:35 +01: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
Massimo Valentini 653484df0b Issue #4467 - (pagecurl) CRITICAL **: g_object_unref: assertion...
...'G_IS_OBJECT (object)' failed

Fix the meson build script to output the right icon path prefix.
2020-01-06 14:49:41 +01:00
Massimo Valentini c33e1263fa Issue #4461 - Spinning Globe fails in gimp-2.99
Fix argument indices.
2020-01-06 14:35:05 +01:00
Jehan 2cd765c000 plug-ins: variable used after being freed.
Once again spotted by Massimo in #4449.
2020-01-03 19:57:59 +01:00
Jehan 189da39805 plug-ins: return value of gimp_procedure_config_begin_export() freed…
… twice.
It should not be freed by the caller since it is annotated as (transfer
none). It gets freed when calling gimp_procedure_config_end_export().
Thanks to Massimo for noticing.
2020-01-03 19:53:54 +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 4fa7d078d0 plug-ins: install Python plug-ins in rwxr-xr-x.
Without the write permission for the owner, the `make install-plug-ins`
special target fails on Python plug-ins. And anyway I don't see a reason
why not give write permission to the owner (like all other plug-ins are
installed).
2019-12-25 11:51:56 +01:00
Michael Schumacher 1f149b15ab plug-ins: correctly renaming plug-ins/gfig/gfig-examples/smily to smiley 2019-12-21 00:18:56 +00:00
luz.paz 2a1713c008 plug-ins: rename plug-ins/gfig/gfig-examples/simily to smiley
+ renamed `plug-ins/gfig/gfig-examples/simily` to `plug-ins/gfig/gfig-examples/smiley`  
+ updated make files  
+ corrected typo
2019-12-19 20:28:00 -05:00
Jehan 7c6a147ffb plug-ins: allow "html" extension for colorxhtml.
There is no reason to limit it to "xhtml" only. Even more, in all
browsers I tried, the exported page was failing to load with the '.xtml'
extension, while it loads fine when renamed as '.html'.

Only problem is that now we have 2 plug-ins able to save as html (other
is file-html-table) and the first in the procedure list (with no
explicit logics right now) will just shadow the next one. We will have
to add some generic infrastructure to allow people to choose favorite
load/export plug-ins, probably in Preferences, next to the raw plug-in
selection.
2019-12-14 14:37:14 +01:00
Jehan 2e40b8d674 meson, autototools: install colorxhtml ported in previous commit. 2019-12-14 13:19:44 +01:00
Elad Shahar a3544fec6f Port pygimp colorxhtml plugin to python 3 2019-12-14 12:38:07 +01:00
Jehan e54467a8fa plug-ins: (meson) install Python plug-ins with execution permission.
Otherwise GIMP will skip them!
2019-11-26 20:24:28 +01:00
Elad Shahar b0ae5f1351 plug-ins: minor fixes to spyrogimp plugin.
Use Gtk Grid instead of deprecated table.
Fix use of some Gtk constants.
Fix top limit of scale widgets by setting page size of Adjustment to 0.
2019-11-26 20:08:59 +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 876199a03f devel-docs, libgimp: update some .gitignore files 2019-11-19 20:40:22 +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
Jehan bf599067ce plug-ins: meson change for previous commit.
In a separate commit to make the rest easier to cherry-pick on
gimp-2-10.
2019-11-06 14:26:23 +01:00
Jehan 31cbc7e0e6 plug-ins: clean all warnings on metadata plug-in.
I made the various static arrays in headers declared as extern and
defined in a separate implementation file, with additional size constant
when necessary (since G_N_ELEMENTS() cannot be used on partially
defined arrays).

Note that this is better than the original implementation, yet I am not
saying this is ideal either. I am not fond of such code organization and
think a better one could be done. But it would require to dive deeper
into this plug-in and I don't want to right now, nor have the time.

At least now it stopped shouting all these warnings!
2019-11-06 14:24:42 +01:00
Jehan 024a919c77 plug-ins: clean out some warnings.
This cleans just a third of the warnings in this metadata plug-in. It is
a very bad practice to define static const strings in a header file like
this, especially if this header is included in several files. Let's make
these macros.

Also why are these header tags sometimes used with the const name (now
macros), sometimes directly with the string literals? I fixed some of
these, but more string literals are lying around.

Remaining warnings are similar, about const string arrays. If really we
want this, we should declare these extern and define them in a separate
implementation file. This whole plug-in should be really reorganized and
cleaned in depth.
2019-11-06 13:36:12 +01:00
Pascal Terjan 85c004edcc Add missing -lm to file-psd plug-in
psd-save.c uses RINT which uses floor(). Not sure why this only
caused a failure on our armv7hl build and why it used to work
but we get:

libtool: link: gcc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wlogical-op -Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type -Wl,--as-needed -Wl,--no-undefined -Wl,-z -Wl,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -o .libs/file-psd psd.o psd-util.o psd-load.o psd-save.o psd-thumb-load.o psd-image-res-load.o psd-layer-res-load.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -pthread  ../../libgimp/.libs/libgimpui-2.0.so ../../libgimpwidgets/.libs/libgimpwidgets-2.0.so ../../libgimpconfig/.libs/libgimpconfig-2.0.so ../../libgimp/.libs/libgimp-2.0.so ../../libgimpcolor/.libs/libgimpcolor-2.0.so ../../libgimpmath/.libs/libgimpmath-2.0.so ../../libgimpbase/.libs/libgimpbase-2.0.so -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpango-1.0 -lharfbuzz -lfontconfig -lfreetype -lgegl-0.4 -lgegl-npd-0.4 -lgmodule-2.0 -ljson-glib-1.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lbabl-0.1 -lz -ljpeg -pthread
/usr/bin/ld: psd-save.o: undefined reference to symbol 'floor@@GLIBC_2.4'
/usr/bin/ld: /lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:756: file-psd] Error 1

And adding -lm seems the right thing to do.

(cherry picked from commit 06b61daa80)
2019-10-31 17:00:01 +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
Sabri Ünal 4d8a61af34 CID 225792 Resource leak in script-fu-server.c
Variable ai and ai_curr going out of scope at line 496.
Variable ai going out of scope at line 545.

Revealed by Coverity Scan.

(cherry picked from commit 1ce1b0eebe)
2019-10-24 18:05:58 +02: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
Michael Natterer 991703a7ee plug-ins: minor cleanups in file-jpeg, no porting to new stuff yet 2019-10-23 19:08:33 +02:00
Sabri Ünal 0b81e4d056 CID: 228176 Fix a Resource leak
This patch fixes a resource leak which was discovered by Coverity Scan.

(cherry picked from commit 3d7d46ea97)
2019-10-23 14:42:07 +02:00
Jehan ca77fb2c95 plug-ins: mktables.c in file-dds is unused.
There were 2 warnings of unused functions on this file, and masking
them, we were ending with a whole file #ifdef-ed 0. So let's just get
rid of the whole useless file.
2019-10-20 17:11:34 +02:00
Sabri Ünal 93a0b640d2 CID 228074: Missing varargs init or cleanup in file-tiff-io.c
missing va_end: va_end was not called for ap_test.

(cherry picked from commit a7a18cc83f)
2019-10-20 14:27:53 +02:00