Skip to content

Commit

Permalink
test 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JoesCat committed Jul 17, 2024
1 parent d18c153 commit 7541fe9
Show file tree
Hide file tree
Showing 12 changed files with 1,911 additions and 22 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
choiceL: [--disable-silent-rules, --enable-silent-rules --enable-debugtime]
choiceL: [--disable-silent-rules, --enable-silent-rules, --enable-debugtime]
steps:
- uses: actions/checkout@v2
- name: Create configure
run: |
sudo apt-get update -y
sudo apt-get install autoconf automake libtool gcc libgimp2.0-dev
sudo apt-get install autoconf automake libtool gcc gimp libgimp2.0-dev
autoreconf -i
automake
- name: Choose configure
Expand All @@ -22,6 +22,12 @@ jobs:
- name: Test make strip
if: matrix.choiceL == '--disable-silent-rules'
run: make strip
- name: Do a make check
if: matrix.choiceL == '--enable-silent-rules'
run: |
cd tests
./test1.sh
cd ..
- name: Test user-level install/uninstall
if: matrix.choiceL == '--disable-silent-rules'
run: |
Expand Down Expand Up @@ -50,7 +56,7 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile.am - Top level automakefile for fix-ca

SUBDIRS = . po
SUBDIRS = . po tests

# The braces around ACLOCAL_FLAGS below instead of parentheses are intentional!
# Otherwise autoreconf misparses the line.
Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AC_PREREQ([2.68])
#
m4_define([fix_ca_name], [gimp-fix-ca])
m4_define([fix_ca_major_version], [4])
m4_define([fix_ca_minor_version], [0])
m4_define([fix_ca_minor_version], [1])
m4_define([fix_ca_version],[fix_ca_major_version.fix_ca_minor_version])
m4_define([fix_ca_package_name], [gimp-fix-ca])
m4_define([fix_ca_package_home], [https://github.com/JoesCat/gimp-fix-ca])
Expand Down Expand Up @@ -51,8 +51,10 @@ AC_PROG_CC
AC_PROG_SED
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PATH_PROG([CHMOD],[chmod],[:])
AC_PATH_PROG([STRIP],[strip],[:])
AC_PATH_PROG([GIMPTOOL],[gimptool-2.0],[:])
AC_PATH_PROG([MD5SUM],[md5sum],[:])
AC_PATH_PROG([MSGFMT],[msgfmt],[:])
AC_PATH_PROG([MSGINIT],[msginit],[:])
AC_PATH_PROG([MSGMERGE],[msgmerge],[:])
Expand Down Expand Up @@ -240,6 +242,7 @@ AH_BOTTOM([
AC_CONFIG_FILES([
Makefile
po/Makefile
tests/Makefile
rpm/gimp-fix-ca.spec
])
AC_OUTPUT
Expand Down
31 changes: 20 additions & 11 deletions fix-ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
#define N_(x) x
#endif

#ifdef TEST_FIX_CA
#define PROCEDURE_NAME "Test-Fix-CA"
#else
#define PROCEDURE_NAME "Fix-CA"
#endif
#define DATA_KEY_VALS "fix_ca"

/* Size controls in Fix CA dialog box */
Expand Down Expand Up @@ -104,7 +108,8 @@ static void fix_ca_region (guchar *srcPTR, guchar *dstPTR,
gint x1, gint x2, gint y1, gint y2,
gboolean show_progress);
static gboolean fix_ca_dialog (gint32 drawable_ID, FixCaParams *params);
static void preview_update (GimpPreview *preview, FixCaParams *params);
//static void preview_update (GimpPreview *preview, FixCaParams *params);
static void preview_update (GimpDrawablePreview *preview, FixCaParams *params);
static int color_size (const Babl *format);
static gdouble get_pixel (guchar *ptr, gint bpc);
static void set_pixel (guchar *dest, gdouble d, gint bpc);
Expand Down Expand Up @@ -238,6 +243,8 @@ static void run (const gchar *name, gint nparams,
#endif
textdomain( GETTEXT_PACKAGE );
#endif
gegl_init (NULL, NULL);

switch (run_mode) {
case GIMP_RUN_NONINTERACTIVE:
fix_ca_params.blue = param[3].data.d_float;
Expand Down Expand Up @@ -317,6 +324,8 @@ static void run (const gchar *name, gint nparams,
}
}

gegl_exit ();

values[0].data.d_status = status;
}

Expand Down Expand Up @@ -348,8 +357,6 @@ static int fix_ca (gint32 drawable_ID, FixCaParams *params)
return -1;
}

//gegl_init (NULL, NULL);

/* fetch pixel regions and setup shadow buffer */
srcBuf = gimp_drawable_get_buffer (drawable_ID);
destBuf = gimp_drawable_get_shadow_buffer (drawable_ID);
Expand Down Expand Up @@ -377,8 +384,6 @@ static int fix_ca (gint32 drawable_ID, FixCaParams *params)
gimp_drawable_merge_shadow (drawable_ID, TRUE);
gimp_drawable_update (drawable_ID, x, y, width, height);

//gegl_exit ();

#ifdef DEBUG_TIME
gettimeofday(&tv2, NULL);

Expand All @@ -393,7 +398,7 @@ static gboolean fix_ca_dialog (gint32 drawable_ID, FixCaParams *params)
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *combo;
GtkWidget *preview;
GtkWidget *preview; /* GimpDrawablePreview widget */
GtkWidget *table;
GtkWidget *frame;
GtkObject *adj;
Expand Down Expand Up @@ -609,19 +614,23 @@ static gboolean fix_ca_dialog (gint32 drawable_ID, FixCaParams *params)
return run;
}

static void preview_update (GimpPreview *preview, FixCaParams *params)
//static void preview_update (GtkWidget *widget, FixCaParams *params)
static void preview_update (GimpDrawablePreview *preview, FixCaParams *params)
{
GimpPreview *ptr;
gint32 preview_ID;
gint b, i, j, x, y, width, height, xImg, yImg, bppImg, bpcImg, size;
GeglBuffer *srcBuf;
guchar *srcImg, *destImg, *prevImg;
const Babl *format;
gdouble d;

preview_ID = gimp_drawable_preview_get_drawable_id (preview);
/* GimpPreview is a subset of GimpScrolledPreview */
ptr = (GimpPreview *)(preview);
gimp_preview_get_position (ptr, &x, &y);
gimp_preview_get_size (ptr, &width, &height);

gimp_preview_get_position (preview, &x, &y);
gimp_preview_get_size (preview, &width, &height);
preview_ID = gimp_drawable_preview_get_drawable_id (preview);

format = gimp_drawable_get_format (preview_ID);
bppImg = babl_format_get_bytes_per_pixel(format);
Expand Down Expand Up @@ -661,7 +670,7 @@ static void preview_update (GimpPreview *preview, FixCaParams *params)
}
}

gimp_preview_draw_buffer (preview, prevImg, width * bppImg/b);
gimp_preview_draw_buffer (ptr, prevImg, width * bppImg/b);

g_object_unref (srcBuf);
g_free(prevImg);
Expand Down
3 changes: 2 additions & 1 deletion org.gimp.extension.fix-ca.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0+</project_license>
<releases>
<release version="4.0" date="2024-02-24" />
<release version="4.1" date="2024-07-11" />
<release version="4.0" date="2024-02-29" />
<release version="3.0.4" date="2023-12-02" />
<release version="3.0.3" date="2022-10-09" />
</releases>
Expand Down
9 changes: 4 additions & 5 deletions rpm/gimp-fix-ca.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
%define moname gimp20-fix-ca
%define plugindir %{_libdir}/gimp/2.0/plug-ins/fix-ca

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

BuildRequires: autoconf
BuildRequires: automake
Expand All @@ -22,14 +22,12 @@ BuildRequires: gtk+2-devel
BuildRequires: pkgconfig(gimp-2.0)
Requires: gimp >= 2.10.0


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


%prep
%setup -q

Expand All @@ -39,13 +37,14 @@ automake --add-missing
%configure
%make_build

%check
make check

%install
%make_install INSTALLDIR="%{buildroot}/%{plugindir}" \
LOCALEDIR="%{buildroot}/%{_datadir}/locale"
%find_lang %{moname}


%files -f %{moname}.lang
%license COPYING
%{plugindir}/fix-ca
Expand Down
Loading

0 comments on commit 7541fe9

Please sign in to comment.