Commit Graph

47088 Commits

Author SHA1 Message Date
Stanislav Grinkov 203393a9fc core: function documentation clarification
Update api documentation of GimpObject and GimpThumbnail classes to
clarify who and when will take care of disposing passed strings.
2021-05-24 11:04:44 +00:00
Stanislav Grinkov f8320ce535
core: minor memleak fixes
Fix several memory leaks when uri obtained by g_file_get_uri ()
was not g_free'd ().
2021-05-23 20:57:44 +06:00
Jehan 8c54a0caa9 build: fix installer creation.
My commit 3fbe59cd3c broke the installer making as I forgot to remove
some rules about lua files. Proof that I should always test first!
2021-05-23 00:53:07 +02:00
Jehan 7a4f0a6f2b gitlab-ci: redirect installer logs to a file.
The logs are just too long for gitlab and ends with:

> Job's log exceeded limit of 4194304 bytes.

This doesn't prevent the job from actually finish successfully. Yet the
day when we will have a build issue, we won't have a way to debug if it
happens close to the end of the installer creation. So let's redirect
both stderr and stdout to a log file and include it in the artifacts.
2021-05-23 00:52:21 +02:00
Jehan 35ef549028 Issue #5879: Legacy icon theme not installed with meson build.
Actually most of the build code was already there but the initial meson
contributor commented the Legacy icon theme out. Not sure why.

I only had to fix a few icon names, which changed into Freedesktop
standard names after commit 1e5cf10585. Other than this, existing meson
build rules seem to work fine AFAICS.
2021-05-22 18:28:58 +02:00
Jehan 3fbe59cd3c build: do not add the same files twice for lua in the installer.
Since we moved most of them to bin/, share/lua*/ and lib/lua/ files are
not necessary anymore (according to my tests so far at least). Let's not
include them.

Also exclude the lua DLL from the generic libraries. It is only for when
the lua option is set.
2021-05-22 16:23:44 +02:00
Jehan f75cad56e0 build: disable javascript plug-ins.
No need to have GIMP trying to run the Javascript goat-exercise at
startup. All it does is make annoying error message on console output.
We know it won't run because no interpreter is available. No need for
trying.
2021-05-22 15:50:56 +02:00
Jehan 076e4d687b gitlab-ci: add a new "packaging" stage.
Unlike what I said in my previous commit, it still just takes too long
to build the installer, whether I move some of the substeps around or
whether I increase the max duration. So rather than increasing max
duration a lot more, let's just add an intermediate stage.
2021-05-22 10:35:06 +02:00
Jehan 7c4f12ee63 gitlab-ci: move the dependency moving step into the build stage.
The last stage (installer creation) takes just too much time, and it
exceeded the max execution time (80 min) in my last test build. Instead
of increasing this max execution time, let's move the run of
package-gimp-msys2.sh script in the same step as the build one. Maybe
adding an intermediate stage would have been better conceptually, but
every stage also takes some preparation and finalization time (setting
up the runner, loading, cleaning the uploading the cache, etc.) and our
installer pipeline is already long enough.
So let's just go like this for now.

As a side effect, the last job's log limit was exceeded too since I
added the Python option, which should hopefully also be fixed by moving
steps out of the installer job.
2021-05-22 10:35:06 +02:00
Jehan 2d15aa00cc build: move lua import files into bin/.
It looks like the DLL ends up searched into bin/lgi/ and other lua files
from bin/lua/. There might be better solutions for the issue, but for
the time being, it seems to work ok.

Note that ender used instead to rebuild lua with the following changes
(cf. IRC):

> src/luaconf.h:
> #define LUA_PATH_DEFAULT \
>   "!\\..\\share\\lua\\5.1\\?.lua;" "!\\..\\share\\lua\\5.1\\?\\init.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;"
> #define LUA_CPATH_DEFAULT \
>   LUA_CDIR"..\\lib\\lua\\5.1\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"

But moving files around in the installed tree is much simpler than
rebuilding the whole lua just for this.
2021-05-22 10:35:06 +02:00
Jehan 49349c78cc build: add lua support to the Windows installer.
Note that I must not install both lua51 with luajit because these are
conflicting. Let's go with luajit from feedback we had on the best
choice (though this topic itself seems a bit heated actually).

Also clean-out the unexpected file removal because now I had the
opposite case, i.e. a CI problem because of this. And from my latest
tests, it seems to work ok for the time being without, which is much
cleaner anyway. So let's go like this for the time being.
2021-05-22 10:35:06 +02:00
Jordi Mas ece8cbe447 Update Catalan translation 2021-05-21 06:48:33 +02:00
Jehan 0625902d71 app: set "OK" the default button to the "Create a New Image" dialog.
In Linux, I never paid attention to it because it was already working as
expected (i.e. Ctrl-n followed by Enter for instance would directly
create the image), but when testing GIMP on Windows for the installer,
these last few days, I realized that hitting Enter when focus was on the
dimension entries was doing nothing. Having to move the pointer to click
a button on Windows was frustrating. So let's make OK the official
"default response" directive for this dialog.
2021-05-20 20:45:28 +02:00
Jehan 18785bf9f1 build: clean out obsolete Windows-specific patches.
- libwmf patch for issue #4061 is applied upstream (libwmf). Even though
  no new libwmf release happened, the MSYS2 package applied the patch to
  libwmf 0.2.12. So it's in our installer. Thanks to lillolollo for
  staying on top of things, as usual.
  Cf. https://github.com/msys2/MINGW-packages/pull/6977
- glib permission issue (#4594 about GIMP preventing the third-party
  software Spotify from starting) is included since glib 2.67.6/2.68.0.
  Since MSYS2 uses glib 2.68.2, it's all good.
- patch for deprecated GTK+2.24 was kept in `master` repo mostly as a
  reminder of having to deal with issue #1082 (former bug 780979) about
  transparent windows from other software interfering with GIMP. This
  was fixed as gtk!2767 which is available since GTK 3.24.27. MSYS2 uses
  GTK 3.24.29 to this day.
  Note that this patch is still relevant in the GIMP 2.10 series (hence
  in gimp-2-10 branch), not in the current GIMP 2.99 series.
2021-05-20 20:26:41 +02:00
Jehan 9c6776fbe4 Issue #6257: Race condition bug in meson build.
Argh! My previous commit logics was right, but should have been applied
to the Windows builds (where the issue happens). That's what happens
when I hack too late at night!
2021-05-20 04:34:57 +02:00
Jehan 11a891b314 Issue #6257: Race condition bug in meson build.
This is not a fix, only a workaround for the CI to at least not fail
randomly, for the time being.

Basically since meson is running parallel jobs, even when the build
fails because git-version.h doesn't exist yet, while a depending file is
being built, it will still be built immediately after, despite the
failure. As a consequence, re-running `ninja` immediately after (i.e.
running `ninja || ninja`) will make the second build work. If it doesn't
then it's another issue which has to be fixed. But at least we work
around this known race condition in the meson build for the time being.

It's very ugly, but better than current situation. :-/
2021-05-20 04:26:24 +02:00
Jehan b815bca8d3 gitlab-ci, build: --enable-windows-installer also on Linux.
By enabling this option on Linux, not only will the installer language
file be generated, but the `make check` will also now validate that the
lang list is consistent with existing gettext files (see commit
8a42c6ccc2). So it's useful information to know this for instance as
soon as some translators add a new localization.

Also oppositely remove the option on the MSYS2 native Windows 32-bit
build. For Windows, we only need this option once, as we use the
language files generated by the 64-bit build.
2021-05-20 02:55:54 +02:00
Jacob Boerema 3b3ab0aa11 plug-ins: fix #6116 grayscale gif animation hangs on export.
GIF export was not taking into account that there can be
both grayscale layers with and without alpha in an image.

We make sure that the GEGL buffer knows the type of
drawable for the current layer.
2021-05-19 17:38:32 -04:00
Jehan ee2a3104e9 meson: fix the build.
Commit a8f020d889 broke the build. I removed a subdir() by mistake.
2021-05-19 23:03:46 +02:00
Jehan 7d9e6e311e build: fix Python support in Windows installer.
Add GObject Introspection libs, python libs and various binaries. Not
sure why we need 3 python binaries. This would need to be investigated
and possibly cleaned up a bit. Similarly maybe it would be better to be
a bit more selective about what we take from lib/python3.8/ folder
(looking what's in there, I wondered if some of the stuff were not
pulled by some dependencies and/or should maybe be filtered out).

But for now, let's make the InnoSetup scripts happy.

In any case, the resulting installer was tested and now Python plug-ins
work successfully. Wouhou!
2021-05-19 22:01:31 +02:00
Jehan 9c62dfd4d4 build: extensions are gimp32/64 specific.
Otherwise the extension files from the 32-bit build override the ones
from the 64-build. This is wrong first because we get 32-bit executables
uselessly (even though Windows 64-bit can run them, we should install
the right ones) and also because we don't build Vala plug-ins on 32-bit
(doesn't work for some reason) and as we override the extension
manifest, the Vala goat exercise is not made available even though it's
installed.
2021-05-19 22:01:21 +02:00
Jehan f647517912 build: job win-installer-nightly should return failure appropriately. 2021-05-19 22:00:53 +02:00
Jehan a8f020d889 meson: -Dwindows-installer also works on Linux build machine.
To this day, the windows-installer option only creates the language
files for the installer. There is just no reason to forbid building them
(hence testing the option works) on non-Windows platforms. In autotools,
it already works fine on all platforms.
2021-05-19 22:00:45 +02:00
Jehan 8a42c6ccc2 build: add a test to check the Windows installer languages.
This way, we will avoid in the future any discrepancies between
languages set in the Windows installer and available translations (po
files in po-windows-installer/) because `make check`/`ninja test` will
fail.
2021-05-19 21:59:18 +02:00
Jehan 9d065b8718 build: create installer with debug symbols and Python support. 2021-05-19 21:59:09 +02:00
Jehan c5b05b6e03 build: separate debug symbols from binaries in the Windows installer.
The shell script was given to me by ender. This is an additional step he
runs after building.
2021-05-19 21:59:00 +02:00
Jacob Boerema 016948c482 plug-ins: load 16-bit per sample SGI images as 16 bit integer
We were loading 16-bit per sample SGI images as 8-bit
integer images even though we have had support for
16-bit integer for a long time now.

Changed to use 16-bit integer encoding now. Saw
this request a while ago on the gimp user mailing list.
2021-05-18 18:53:59 -04:00
Jehan 90ee7bd417 NEWS: update. 2021-05-18 16:59:13 +02:00
Rodrigo Lledó 0d479b4e3e Update Spanish translation 2021-05-18 12:01:58 +00:00
Rodrigo Lledó 625c437352 Update Spanish translation 2021-05-18 11:33:35 +00:00
Jacob Boerema e1fcaaaa0a plug-ins: always stop on error after reading PSD layer block. 2021-05-17 21:27:07 -04:00
Jacob Boerema be20a25ec6 plug-ins: additional layer info in PSD images can have multiple resources.
Instead of only checking for the layer resources Lr16 and Lr32 make it
a loop and use the generic get_layer_resource_header to read all
resources.

We still need to figure out at a later time how to best handle these
resources.
2021-05-17 21:27:07 -04:00
Jacob Boerema d99b87c529 plug-ins: add support for reading Photoshop PSB image files. 2021-05-17 21:27:07 -04:00
Jacob Boerema 35f4b7b517 plug-ins: make PSD resource loading handle 64-bit lengths.
For PSB images certain resources have 64-bit lengths.
Let's handle this transparently by adding a psd_version
parameter and depending on that and the type of
resource we decide if the length to read is 32 or 64-bit.

We also return the total header size. This way the
calling function can use that to determine the
remaining length.

Because we needed to check the signature when
loading the header we remove that check from
the load_layer_resource function since that
would be redundant.
2021-05-17 21:27:06 -04:00
Jacob Boerema 6f523d33dd plug-ins: adjust some psd-load debug statements for 64-bit. 2021-05-17 21:27:06 -04:00
Jacob Boerema 2df0569a50 plug-ins: PSD ChannelLengthInfo data_len should be 64 bit. 2021-05-17 21:27:06 -04:00
Jacob Boerema 0de02a5b2d plug-ins: PSD layer size validation only for "normal" layers.
Apparently layer height or width can be negative for certain
PSD layers that have the irrelevant flag set.

We move those checks down until after we have read that
flag and only validate if the irrelevant flag is not set.
2021-05-17 21:27:06 -04:00
Jacob Boerema f82974a70e plug-ins: in psd-load.c change debug state to 4 for 1 bit conversion details.
Since the 1-bit conversion debug statements causes a huge amount
of info which can cause slowdowns when loading do it only when
explicitly setting it to IFDBG(4).
2021-05-17 21:27:06 -04:00
Jacob Boerema 714052e998 plug-ins: remove outdated comment about GIMP_MAX_IMAGE_SIZE in psd-load.c
GIMP_MAX_IMAGE_SIZE is nowadays 524288.
2021-05-17 21:27:06 -04:00
Jacob Boerema 2e2e43a404 plug-ins: add psd_read_len function
In certain places in a PSB file we need to read 64-bit
lengths where in a PSD we read a 32-bit length.

To make handling this easier we add a function that
determines if we need to read 4 or 8 bytes and 
also handles converting the value from big endian.
2021-05-17 21:27:06 -04:00
Jacob Boerema 0a703115d1 plug-ins: increase MAX_CHANNELS in PSD files to 99.
Even though the current specs say max is 56 there
are sample files with more channels. Since there is
no reason why we can't handle more let's increase
the maximum to 99 for now.
2021-05-17 21:27:06 -04:00
Jacob Boerema 32be0ec709 plug-ins: PSD layer name can be NULL.
Apparently in a PSD a layer name can be NULL which
gimp_item_set_name doesn't like so only use it when
we have a valid layer name.
2021-05-17 21:27:06 -04:00
Jacob Boerema 58183e55c6 plug-ins: store PSD file version in our PSDimage data structure. 2021-05-17 21:27:05 -04:00
Jehan f98ccf5b32 build: Windows installer version deduced from configure.ac.
I left the version I was using while testing, but this is obviously
wrong as we would always forget to update it (actually even now it was
wrong as it was producing an installer versionned 2.99.6 whereas it
should have been 2.99.7!). Instead let's grep the major/minor/micro from
the build system.
2021-05-17 16:03:24 +02:00
Jehan 5a366ee0d2 gitlab-ci: reorganize pipeline rules.
The goal is to make it easier to understand which pipeline is run when,
for future maintenance, and also to make it easy to trigger a specific
pipeline through Gitlab pipeline interface.
2021-05-17 14:34:29 +02:00
Jehan 62ae32123a build: add aalib dependency for ASCII Art support.
- Adding a patch sent to me by Sylvie Alexandre meant to help aalib
  build on MSYS2 for Windows 32 and 64-bit.
- Additionally, add an additional patch from myself because it was still
  not building properly.
- Also update the config.guess|sub files because the original ones (from
  2001!) were just too old and not properly recognizing the host mingw
  system (especially the 64-bit one apparently) in the MSYS2 CI jobs of
  GIMP.
- Finally regenerate the whole aclocal/libtoolize/autoconf/automake
  build system because these old files just don't play nice with recent
  autotools though the source files still regenerate fine (despite with
  some warnings, but nothing blocking).
- Add crt-git dependency because libws2_32 is in there.
2021-05-17 13:15:31 +02:00
Jehan a181d672ef configure: better libaa detection.
- Use aalib-config (available at least in the last releases of libaa,
  1.4rc5 from 20 years ago!). Especially important as the basic
  AC_CHECK_LIB() test does not work in my tests on Windows builds
  because some more libs are needed.
- Make sure file-aa is also built if AA_LIBS environment variable is
  explicitly set. Prevous code was not working in such case (file-aa was
  not built even with AA_LIBS set).
2021-05-17 13:15:31 +02:00
Jehan cf6482f716 build: more optional feature to Windows installer.
headers-git package needed for DirectInput.
2021-05-17 13:15:30 +02:00
Jehan de31d65daa gitlab-ci: gimp-distcheck-debian and gimp-autotools-debian redundant.
We had an autotools build stopping at `make check` and a separate one
for `make distcheck`. This just seems very redundant hence a waste of
resources.
So let's drop the job gimp-autotools-debian then add a `make check` step
to gimp-distcheck-debian.

Also as a side change, I move the cppcheck to being a scheduled job.
It's not such resource intensive job, nor did it take much time, yet
it's not like we use this information constantly. Moreover it never
fails anyway (so it's not like it gives much information on a per-commit
basis, unless we explicitly look into the resulting files) and with the
ability to run custom jobs whenever we want, this is far enough if
sometimes we need to generate the cppcheck analysis more frequently.
The rest of the time, having 2 jobs of this a week (our current
schedule) is far enough.
2021-05-14 19:56:55 +02:00
Jehan 1d03258797 gitlab-ci, build: construct the Windows installer from CI.
Run InnoSetup in the Windows CI to build the installer from both the 32
and 64-bit builds.

Current limitations:
- No installer signature yet.
- Dependencies will have to be checked more thoroughly.
- Apart from babl and GEGL, we may want to make custom builds of any
  package which has a patch in build/windows/patches/ (Windows-specific
  patches) and build/patches/ (all platform patches).
- Plug-in interpreters (Python, Lua…) don't work. This will need to be
  looked at in detail.

Globally this first automated installer build works fine though, as I
could install it in a Windows 10 VM and GIMP ran fine! So it's a first
step towards fully automated releases for Windows.
2021-05-14 19:27:30 +02:00