Commit Graph

7914 Commits

Author SHA1 Message Date
Thomas Manni 806d260601 script-fu: in weave, improve context and undo management
Use a gimp-context-push/pop at the beginning/end of the script
to keep the current context unchanged.

Add undo support for the whole procedure.
2018-05-16 21:44:30 +02:00
Jehan 9fb1c28687 plug-ins: properly free rectScreens after allocating it.
Also avoid global variables when possible. We can just use the data
variable of EnumDisplayMonitors() which will be passed on to the
callback. This is not perfect yet since rectScreensCount is still
global, but let's go for it for now.
2018-05-16 00:39:46 +02:00
Jehan e357e7118c plug-ins: fixing various compilation warnings.
Mostly warnings about wrong types for some function parameters.
There is still a single warning remaining about ignoring the #pragma
macro, but I am not sure what to do about this warning. Apparently it is
something specifically for use with Visual Studio. We don't need this,
but since the contributor uses it, let's keep it.
2018-05-16 00:39:46 +02:00
Jehan 382d6c8ad5 plug-ins: put the initial foreground window back after a screenshot.
This was lost in commit 966843564d. It's not a big deal since this code
path would only happen when the capture using magnification API fails,
yet we may as well make it perfect.
Also taking the opportunity to change the return type to gboolean for
the various capture functions (though it is technically the same,
semantically we were returning success boolean).
And removing a comment which had been duplicated and left at a the wrong
place.
2018-05-16 00:39:10 +02:00
Jehan a0b28589ac plug-ins: properly load user32.dll for SetProcessDPIAware().
Using similar code as other parts of Win32 code.
I hope I am not doing anything wrong. At least now it builds!
2018-05-16 00:39:10 +02:00
Gil Eliyahu ae93b6db18 Plug-ins: fix screenshot bugs in windows.
This fixes bugs 793722 and 796121.
In particular it fixes:
- Single-window screenshot when partly off-screen or covered by another
  window.
- Screenshots when display scaling is not 100%.
2018-05-16 00:39:10 +02:00
Thomas Manni d01bf70f86 script-fu: in slide, use an undo group when working on the initial image 2018-05-15 17:58:11 +02:00
Thomas Manni 316adffaae script-fu: in fuzzy-border, add undo support for the whole procedure 2018-05-15 17:36:27 +02:00
Thomas Manni 9c547e7d71 Bug 795958 - Effect (like "old photo") does not group undo information properly
When working on the current image, enclose the script actions in an undo group.

When working with a copy of the image, disable the undo stack of the new image
at the beginning of the script and reenable it at the end.
2018-05-15 11:40:08 +02:00
Ell 4d4881fe83 plug-ins: in selection-to-path, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell 2d421d7f07 plug-ins: in smooth-palette, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
Ell eece91eb06 plug-ins: in file-html-table, use sampler object ...
... instead of gegl_buffer_sample()

Ditto.
2018-05-13 19:40:46 -04:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Jehan 9d9e9c707e plug-ins: minor cleanup.
In particular tabs were left out in the new file-heif plug-in.
2018-05-11 23:29:40 +02:00
Jehan 05145f44f2 plug-ins: set appropriate status when file-heif's load_image() fails.
Current code was only taking into account cancelation, so we could end
with weird plug-in return:

> HEIF/HEIC plug-in returned SUCCESS but did not return an image

Instead properly set an error status, and echo back the error from the
plug-in or libheif.
2018-05-11 22:48:23 +02:00
Ell 7540ce779d Bug 795716 - Wavelet Decompose takes too long to group layers
Use gimp_image_{freeze,thaw}_layers(), added in the previous
commit, to suppress updates to the Layers dialog while constructing
the decomposed layers, which significantly speeds up the operation
if the dialog is mapped.
2018-05-07 02:56:10 -04:00
Simon Budig 5a048f5b5d imagemap: fix invalid source removal 2018-05-05 20:01:57 +02:00
Michael Natterer b706eaf002 plug-ins: enable metadata loading in file-heif
Do it half-manually for now. Also, there doesn't seem to be metadata
saving API in libhaif.
2018-05-05 14:38:27 +02:00
Michael Natterer 15b9bb1581 plug-ins: port file-heif to GIO 2018-05-05 12:53:39 +02:00
Michael Natterer 7e3fa0c8d8 plug-ins: port file-heif to GEGL, and don't use any deprecated API 2018-05-04 21:14:23 +02:00
Michael Natterer ba149f1759 plug-ins: add HEIF loading/saving plug-in written by Dirk Farin
Thanks a lot to Dirk for contributing this, added him to AUTHORS.

Import the code from https://github.com/strukturag/heif-gimp-plugin.git
as of today. Merged the files into a single-file plug-in. Changed
the code a lot to match our coding style, but only formatting,
no logic changes.

Still uses deprecated GimpDrawable API and no GIO, but I wanted to do
actual code changes separately from the initial import. Also disabled
metadata support because updating that to GimpMetadata was too much
for the initial import.
2018-05-04 20:49:56 +02:00
Michael Natterer 62279047b1 Bug 795763 - Update gimp.org links to https://
Update links to https:// in "About". the "Help" menu, and several
user-visible error messages.
2018-05-03 00:27:29 +02:00
Ell 474e27b27a Bug 795693 - GIMP doesn't enable visibility of vector layers in PSD
In the file-psd plug-in, ignore the 'irrelevant' flag of layers
when loading PSD files; in particular, don't hide such layers
unconditionally.  The 'irrelevant' flag seems to indicate that the
layer's content can be entirely derived without using the layer's
pixel data, and not that the layer itself it irrelevant.
2018-05-01 02:49:19 -04:00
Alexandre Prokoudine 1811d8ebf9 script-fu: fix a typo in the Add Border script 2018-04-30 18:10:08 +03:00
Michael Natterer f3bf8cd53f plug-ins: don't use gimp_rgb_to_cmyk_int() in newsprint 2018-04-28 14:44:23 +02:00
Jan Tojnar aa67a0228b Bug 795620 - Missing gegl in rpath of python/gimp.so
gegl was not listed as a dependency of python/gimp.so, which
omitted it from rpath, breaking the plug-ins on Nix, which relies
on rpaths.
2018-04-28 11:53:44 +02:00
Michael Natterer 710ac0fb52 Bug 795611 - unit-editor.c: Boolean result is used in bitwise operation
Fix "or" expression: it's || not |.
2018-04-28 02:48:56 +02:00
Michael Natterer f35c2cdcec script-fu: port chrome-it.scm to non-deprecated color API 2018-04-26 15:45:04 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Simon Budig e6de783b3c remove the ripple plugin, provide compat PDB-API 2018-04-24 13:05:58 +02:00
Michael Natterer b80036e14f pdb: deprecated gimp-layer-translate
and port all plug-ins/scripts to gimp-item-transform-translate.
2018-04-23 15:49:23 +02:00
luz.paz 147c09f19e Bug 795161 - Misc. typo fixes in source comments and doxygen
Found via `codespell`
Follow-up to  commit 7fdb963e01
2018-04-18 21:06:57 +02:00
Tobias Ellinghaus fff0717632
PFM: Fix writing with ',' as decimal separator
Some locales (like German) use ',' as the decimal separator, so using
printf like functions to output a float value fails when the result
should always use '.'. Since there are only two distinct possibilities
we just write the string representation and be done with it.
2018-04-16 23:54:45 +02:00
Michael Natterer 233ac80de1 script-fu: port all scripts to the new gimp-drawable-edit functions 2018-04-16 20:12:12 +02:00
Michael Natterer 5ee67deea5 pdb: deprecate all non-clipboard functions in the "edit" group
Still have to port script-fu scripts...
2018-04-15 16:39:59 +02:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Jehan 6936a655bd plug-ins: minor fix of an error string.
Was reading this part of the code when I saw this: the error happens
when loading not exporting a PNG.
2018-04-04 02:21:47 +02:00
Zhouyang a6fd24a953 Bug 793951 - Fix crashes when some external APIs fail
Check the return values of some functions and set errors or print
a message to stderr if they fail.
2018-03-26 21:27:42 +02:00
Jehan 34b68a2c1d plug-ins: rename s/YUV/YCbCr/ s/eYCC/xvYCC/ s/RGB/sRGB/.
Exchanging with OpenJPEG developers and searching more on the topic, it
seems that YUV is more often refered to as YCbCr. Wikipedia says:

> typically the terms YCbCr and YUV are used interchangeably, leading to
> some confusion. The main difference is that YUV is analog and YCbCr is
> digital

As for eYCC, I am told this is extended YCC. It seems this is refered as
xvYCC (I really can't find much under "eYCC"). So let's rename it too.

Hopefully I made no mistakes!
2018-03-20 17:09:31 +01:00
Jehan 5732b7ab6d plug-ins: add a color space parameter to file-j2k-load().
JPEG 2000 codestream doesn't have a header and guessing the color space
in particular is not foolproof (especially when 3 or 4 components, which
can be many spaces). Therefore the need of a parameter on the API.

Note that JP2 images should always have the color space information. In
interactive mode, I try to be a bit flexible to salvage broken JP2 with
no color space information in the header, but I am not adding a
parameter in file-jp2-load() (on purpose, since we are not going to add
in the API a parameter for a case not supposed to happen with properly
encoded files).
2018-03-20 16:52:04 +01:00
Jehan 7e52c48364 plug-ins: open a dialog to select color space of JPEG 2000 codestream.
JPEG 2000 codestream (.j2k/.j2c) are only compressed code stream data,
without header. In particular we don't have color information, such as
the color space. So we need to open a dialog asking to set the color
space in interactive mode.

Note: according to OpenJPEG developers, a JP2 image (not codestream)
should always have a color space defined in its header. But just to be
flexible, the same dialog may get raised as well if we try to load a JP2
with no valid color space defined in header and no ICC profile embedded.
Maybe if such a thing happened, it means the image is corrupt, yet we
may as well try and salvage it anyway.

Note 2: I also removed a weird test which was setting some images as
being YUV color space by mistake. This actually fixes bug 794413 as a
side effect.
2018-03-20 14:50:23 +01:00
Jehan 5e5fa4a024 plug-ins: .jpc is another known extension for JPEG 2000 codestream.
Even though I haven't seen working samples with this extension,
according to some references, this is a common extension for compressed
JPEG 2000 code stream. Also our old plug-in was listing this extension,
so let's do so now as well.

To this day, the only 2 extensions we used to list in the JasPer-based
plug-in and not in the OpenJPEG one are .jpf and .jpx (JPEG 2000 Part-2)
since OpenJPEG does not have support yet. But actually I think the old
plug-in may have simply been "lying" since JasPer website says the
library is meant to implement JPEG-2000 Part-1 standard.
So I believe we are now on par (and even better on many aspects) with
the former plug-in implementation based on libjasper.
2018-03-20 02:05:49 +01:00
Jehan f2c80e1878 plug-ins: coding style cleaning.
Trailing whitespaces here and there, alignment issues, and so on…
Also get rid of an unused variable.
2018-03-16 22:08:40 +01:00
Darshan kadu a9a3a67cf2 plug-ins: 16/32 bit JPEG2000 support. 2018-03-16 21:39:08 +01:00
Jehan 4fdf301dea plug-ins: properly check widget class holding tag data.
Some tag data is hold in GtkEntry, other in GtkTextView, which are not
parent to each other. Previous checks were wrong and resulted in
"invalid cast from 'GtkEntry' to 'GtkTextView'" WARNINGs (followed by
many CRITICALs because of this first error).

Also properly free the data returned by gtk_text_buffer_get_text() which
is allocated (unlike strings returned by gtk_entry_get_text() which must
not be freed).
2018-03-16 20:20:24 +01:00
Ell a7f3a2dd9f app, pdb, libgimp, plug-ins, menus: rename layer composite modes
Our composite modes don't correspond directly to the Porter-Duff
operators after which they're named, and these names aren't too
descriptive anyway.

Rename the composite modes as follows:

  Source Over       =>  Union
  Source Atop       =>  Clip to Backdrop
  Destination Atop  =>  Clip to Layer
  Source In         =>  Intersection

Update relevant code, including UI text, enumerator names, function
names, and action names.
2018-03-14 16:19:09 -04:00
Jehan 8de34f704d plug-ins: clean a bit commented-out code.
These are remnants from the old Jasper implementation and should have
been deleted days ago.
2018-03-10 03:14:54 +01:00
Jehan a9ff5e14ce plug-ins: run gimp_image_set_color_profile() after image creation.
After moving up the profile extraction, I was running
gimp_image_set_color_profile() with a non-existing image id, which was
obviously wrong. Reorder a bit the operations.

Also try to guess the color space from the profile not only with
OPJ_CLRSPC_UNSPECIFIED but also OPJ_CLRSPC_UNKNOWN images. Indeed I
encountered a case of .jp2 image with no color space in the header, but
with an embedded profile. And unlike the .j2c files I encountered
earlier, the color space was now *_UNKNOWN.
See https://github.com/uclouvain/openjpeg/issues/1103
2018-03-10 02:00:07 +01:00
Jehan 3d55452933 Bug 794152 - JPEG 2000 Code Stream .j2c support.
Current OpenJPEG code only supported the base JP2 container. It now
supports also the JPEG 2000 codestream (which is usually contained
inside other formats, like the JP2 container format, but can also
sometimes be on its own).
The current magics and extension strings were also mixing all kind of
formats. This is now cleaned up a bit.
2018-03-10 00:03:15 +01:00