Skip to content

Commit 3405696

Browse files
committed
gimp-plugin-fix-ca 4.1 (July 10, 2024)
- Fixed bug in fix-ca.c to run in non-interactive script mode. - Added make check due to testing non-interactive scripting mode.
1 parent d18c153 commit 3405696

File tree

10 files changed

+65
-12
lines changed

10 files changed

+65
-12
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
- name: Test make strip
2323
if: matrix.choiceL == '--disable-silent-rules'
2424
run: make strip
25+
- name: Do a make check
26+
if: matrix.choiceL == '--enable-silent-rules'
27+
run: make check
2528
- name: Test user-level install/uninstall
2629
if: matrix.choiceL == '--disable-silent-rules'
2730
run: |

Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile.am - Top level automakefile for fix-ca
22

3-
SUBDIRS = . po
3+
SUBDIRS = . po tests
44

55
# The braces around ACLOCAL_FLAGS below instead of parentheses are intentional!
66
# Otherwise autoreconf misparses the line.

configure.ac

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ AC_PREREQ([2.68])
2121
#
2222
m4_define([fix_ca_name], [gimp-fix-ca])
2323
m4_define([fix_ca_major_version], [4])
24-
m4_define([fix_ca_minor_version], [0])
24+
m4_define([fix_ca_minor_version], [1])
2525
m4_define([fix_ca_version],[fix_ca_major_version.fix_ca_minor_version])
2626
m4_define([fix_ca_package_name], [gimp-fix-ca])
2727
m4_define([fix_ca_package_home], [https://github.com/JoesCat/gimp-fix-ca])
@@ -51,8 +51,10 @@ AC_PROG_CC
5151
AC_PROG_SED
5252
AC_PROG_LN_S
5353
AC_PROG_MKDIR_P
54+
AC_PATH_PROG([CHMOD],[chmod],[:])
5455
AC_PATH_PROG([STRIP],[strip],[:])
5556
AC_PATH_PROG([GIMPTOOL],[gimptool-2.0],[:])
57+
AC_PATH_PROG([MD5SUM],[md5sum],[:])
5658
AC_PATH_PROG([MSGFMT],[msgfmt],[:])
5759
AC_PATH_PROG([MSGINIT],[msginit],[:])
5860
AC_PATH_PROG([MSGMERGE],[msgmerge],[:])
@@ -240,6 +242,7 @@ AH_BOTTOM([
240242
AC_CONFIG_FILES([
241243
Makefile
242244
po/Makefile
245+
tests/Makefile
243246
rpm/gimp-fix-ca.spec
244247
])
245248
AC_OUTPUT

fix-ca.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@
4949
#define N_(x) x
5050
#endif
5151

52+
#ifdef TEST_FIX_CA
53+
#define PROCEDURE_NAME "Test-Fix-CA"
54+
#else
5255
#define PROCEDURE_NAME "Fix-CA"
56+
#endif
5357
#define DATA_KEY_VALS "fix_ca"
5458

5559
/* Size controls in Fix CA dialog box */
@@ -238,6 +242,8 @@ static void run (const gchar *name, gint nparams,
238242
#endif
239243
textdomain( GETTEXT_PACKAGE );
240244
#endif
245+
gegl_init (NULL, NULL);
246+
241247
switch (run_mode) {
242248
case GIMP_RUN_NONINTERACTIVE:
243249
fix_ca_params.blue = param[3].data.d_float;
@@ -317,6 +323,8 @@ static void run (const gchar *name, gint nparams,
317323
}
318324
}
319325

326+
gegl_exit ();
327+
320328
values[0].data.d_status = status;
321329
}
322330

@@ -348,8 +356,6 @@ static int fix_ca (gint32 drawable_ID, FixCaParams *params)
348356
return -1;
349357
}
350358

351-
//gegl_init (NULL, NULL);
352-
353359
/* fetch pixel regions and setup shadow buffer */
354360
srcBuf = gimp_drawable_get_buffer (drawable_ID);
355361
destBuf = gimp_drawable_get_shadow_buffer (drawable_ID);
@@ -377,8 +383,6 @@ static int fix_ca (gint32 drawable_ID, FixCaParams *params)
377383
gimp_drawable_merge_shadow (drawable_ID, TRUE);
378384
gimp_drawable_update (drawable_ID, x, y, width, height);
379385

380-
//gegl_exit ();
381-
382386
#ifdef DEBUG_TIME
383387
gettimeofday(&tv2, NULL);
384388

org.gimp.extension.fix-ca.metainfo.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
<metadata_license>CC0-1.0</metadata_license>
3939
<project_license>GPL-3.0+</project_license>
4040
<releases>
41-
<release version="4.0" date="2024-02-24" />
41+
<release version="4.1" date="2024-07-10" />
42+
<release version="4.0" date="2024-02-29" />
4243
<release version="3.0.4" date="2023-12-02" />
4344
<release version="3.0.3" date="2022-10-09" />
4445
</releases>

rpm/gimp-fix-ca.spec.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,31 @@
44
%define moname gimp20-fix-ca
55
%define plugindir %{_libdir}/gimp/2.0/plug-ins/fix-ca
66

7-
Name: @FIX_CA_PACKAGE_NAME@
7+
Name: gimp-fix-ca
88
Version: @FIX_CA_VERSION@
99
Release: 0
1010
Summary: A Gimp2 plugin for correcting Chromatic Aberration (CA)
1111
License: GPLv3+
1212
Group: Graphics/Editors and Converters
1313
URL: https://github.com/JoesCat/gimp-fix-ca
14-
Source0: https://github.com/JoesCat/gimp-fix-ca/releases/download/%{version}/%{name}-%{version}.tar.gz
14+
Source0: https://github.com/JoesCat/gimp-fix-ca/archive/%{version}/gimp-fix-ca-%{version}.tar.gz
1515

1616
BuildRequires: autoconf
1717
BuildRequires: automake
1818
BuildRequires: gcc
1919
BuildRequires: make
20+
BuildRequires: md5sum
2021
BuildRequires: gettext-devel
2122
BuildRequires: gtk+2-devel
2223
BuildRequires: pkgconfig(gimp-2.0)
2324
Requires: gimp >= 2.10.0
2425

25-
2626
%description
2727
A Gimp2 plug-in to correct Chromatic Aberration (CA).
2828
Fix-CA can fix Lateral CA caused due to light travelling through lenses,
2929
and fix Directional CA due to light travelling through dense material
3030
such as glass or water.
3131

32-
3332
%prep
3433
%setup -q
3534

@@ -39,13 +38,14 @@ automake --add-missing
3938
%configure
4039
%make_build
4140

41+
%check
42+
make check
4243

4344
%install
4445
%make_install INSTALLDIR="%{buildroot}/%{plugindir}" \
4546
LOCALEDIR="%{buildroot}/%{_datadir}/locale"
4647
%find_lang %{moname}
4748

48-
4949
%files -f %{moname}.lang
5050
%license COPYING
5151
%{plugindir}/fix-ca

tests/Makefile.am

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
scripttests = test1.sh
2+
3+
AM_CFLAGS = ${CFLAGS} ${CPPFLAGS} ${GIMP_CFLAGS} ${GTK_CFLAGS} ${WCFLAGS} ${FCA_CFLAGS} -I${top_srcdir} -I${top_builddir}
4+
5+
AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} ${GIMP_CFLAGS} -I${includedir}
6+
7+
EXTRA_DIST = test-fix-ca.c test.scm test1.md5
8+
9+
noinst_PROGRAMS = test-fix-ca
10+
test_fix_ca_name = test-fix-ca
11+
test_fix_ca_SOURCES = test-fix-ca.c
12+
test_fix_ca.$(OBJEXT): fix-ca-config.h
13+
test_fix_ca_LDADD = ${LIBS} ${GIMP_LIBS} ${GTK_LIBS} ${WSLIB} ${FCA_LIB}
14+
15+
update-tests: $(scripttests)
16+
17+
$(scripttests):
18+
echo "#!/bin/sh" > ${builddir}/test1.sh; \
19+
echo "rm -f ${builddir}/test1.tga" >> ${builddir}/test1.sh; \
20+
echo "${GIMPTOOL} --install-script ${srcdir}/test.scm" >> ${builddir}/test1.sh; \
21+
echo "${GIMPTOOL} --install-bin ${builddir}/test-fix-ca" >> ${builddir}/test1.sh; \
22+
echo "gimp --verbose --console-messages -b '(test \"${top_srcdir}/img-fix-ca/full-branches.jpg\" \"${builddir}/test1.tga\" 6.0 -2.4 658 1280 1 0.0 0.0 0.0 0.0)' -b '(gimp-quit 0)'" >> ${builddir}/test1.sh; \
23+
echo "${GIMPTOOL} --uninstall-bin test-fix-ca" >> ${builddir}/test1.sh; \
24+
echo "${GIMPTOOL} --uninstall-script test.scm" >> ${builddir}/test1.sh; \
25+
echo "${MD5SUM} -c ${top_srcdir}/tests/test1.md5" >> ${builddir}/test1.sh; \
26+
${CHMOD} +x ${builddir}/test1.sh
27+
28+
TESTS = ${builddir}/test1.sh
29+
30+
clean-local:
31+
rm -f ${builddir}/test?.sh ${builddir}/test?.tga
32+
33+
.PHONY: update-tests

tests/test-fix-ca.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define TEST_FIX_CA 1
2+
#include "../fix-ca.c"

tests/test.scm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(define (test filename result bluel redl lensx lensy interpolation bluex redx bluey redy)
2+
(define image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
3+
(define drawable (car (gimp-image-get-active-layer image)))
4+
(Test-Fix-CA RUN-NONINTERACTIVE image drawable bluel redl lensx lensy interpolation bluex redx bluey redy)
5+
(gimp-file-save RUN-NONINTERACTIVE image drawable result result)
6+
(gimp-image-delete image))

tests/test1.md5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7e59db2f8eeafbc0a37d5fddde45c14c test1.tga

0 commit comments

Comments
 (0)