Commit graph

3836 commits

Author SHA1 Message Date
Alex Samorukov
8f3da0e8c4 Allow compilation on MacOS 10.5 leopard: issues #2923, #2924 and #2925 2019-03-23 23:33:07 +00:00
Ell
2dad85b84f libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:43:13 -05:00
Jehan
7812aced5d Issue #1256: Import damages colormap numbering.
Do not remove fully transparent colors from the PNG palette.
2019-03-08 15:12:04 +01:00
Michael Natterer
4ee74a11e6 app, plug-ins: move brush pipe saving from the file-gih plug-in to the core
As with .gbr and .pat, only the actual saving code, not the export
logic and GUI.

(cherry picked from commit cc7e07fecb)
2019-03-03 20:07:07 +01:00
Ell
50a09d2451 Issue #2997 - Error importing PCX
Commit dc069e424a removed the
assumption that 1-bpp PCX files are B&W, in favor of using the
provided palette, which is (supposedly?) the correct behavior.
However, there are evidently B&W files that do not specify a
palette, resulting in an all-black image (i.e., a 2-color indexed
image, whose both palette entries are black).  Since other
software, including older versions of GIMP, load such files
"correctly", let's fix this by falling back to a B&W palette when
the provded palette is uniform.

(cherry picked from commit 11defa4271)
2019-02-22 12:02:14 -05:00
Michael Natterer
088418e004 app, plug-ins: move file-gih-load from the file-gih plug-in to the core
(cherry picked from commit 52adaa1963)
2019-02-19 23:48:55 +01:00
Michael Natterer
a04e24ce3e app, plug-ins: move brush (gbr) saving to the core
just the export logic remains in the plug-in, just as for patterns.

(cherry picked from commit 90164c4951)
2019-02-16 19:02:30 +01:00
Michael Natterer
c08932cab0 plug-ins: forward the error message if file-pat-save-internal fails
(cherry picked from commit b71ebcea6d)
2019-02-16 19:02:20 +01:00
Michael Natterer
64d0e29e42 plug-ins: remove stuff that is no longer needed from file-pat
(cherry picked from commit 52b1348f3d)
2019-02-12 21:39:23 +01:00
Michael Natterer
7ce90a19b4 app, plug-ins: move pattern saving to the core
but only the actual saving code, not the export magic and dialog.

Add new internal procedure file-pat-save-internal which is not
registered as a file procedure and always works non-interactively on
the passed arguments and only saves the passed drawable. Use the new
internal procedure from the file-pat-save code and remove all file
writing code from the plug-in.

This way all pattern file writing code duplication is killed, while
the whole export mechanism is completely unchanged.

(cherry picked from commit b29ecfb5da)
2019-02-12 21:34:17 +01:00
Michael Natterer
b3797079bc app: move file-pat-load from the file-pat plug-in to the core
(cherry picked from commit 410ffc435e)
2019-02-11 18:39:04 +01:00
Michael Natterer
616f5aac11 app, plug-ins: start consolidating brush and pattern loading/saving code
We currently have brush and pattern I/O code in both the core and
plug-ins. This commit starts removing plug-in code in favor of having
one copy of the code in the core, much like XCF loading and saving is
implemented.

Add app/file-data/ module with file procedure registering code, for
now just with an implementation of file-gbr-load.

Remove the file-gbr-load code from the file-gbr plug-in.

(cherry picked from commit a4e77e57f6)
2019-02-11 12:56:56 +01:00
sabri ünal
9c6c064356 Typo
(cherry picked from commit 43fb9242ca)
2019-01-24 23:33:34 +01:00
Michael Natterer
c924d60ea6 Issue #1793 - Move Guillotine tool to a different position in menus...
...(and rename it)

Move it into the "Crop" group of the image menu and call it "Slice
Using Guides".

(cherry picked from commit 5fffadba54)
2019-01-05 14:58:18 +01:00
Jehan
582caf5a4a Issue #2611: Cannot open certain .pdf files in GIMP.
I am unsure of the problem, but it is fixed by using
poppler_document_new_from_gfile() instead of giving the contents of a
GMappedFile to poppler_document_new_from_data().
Using GFile is anyway usually prefered so I don't dig up more and just
make this change.

(cherry picked from commit a89e503054)
2019-01-02 22:58:56 +01:00
Michael Natterer
ffbe7282be Issue #2617 - Export to C image artifacts
As correctly spotted by Royce Pipkins, the buffer for the drawable's
pixel lines was too small.

Also fix the plug-in to hardcode "R'G'B'[A] u8" so it won't misbehave
on high bit-depth images, and make it work on all sorts of drawables,
not only "RGB*" (it will still always export RGB images).

(cherry picked from commit 74c9d835e8)
2019-01-02 21:29:18 +01:00
Jehan
ab851924dd plug-ins: make various usage of g_file_replace() safer.
As I did on app/, finalizing an output stream also implicitly flushes
and closes it. Hence if an export ended with an error, we'd end up with
incomplete data file (possibly overwriting a previously exported image).
Only 2 plug-ins I haven't fixed yet are file-tiff-io and file-gif-save.
The later one don't even clean up its memory (which somehow is good here
as at least the output stream is never finalized hence sane files are
not overwritten in case of errors). As for the former (TIFF plug-in), it
doesn't even seem to have any error control AFAICS, apart from printing
error messages on standard error output.

(cherry picked from commit 66ec467217)
2018-12-07 00:51:13 +01:00
Michael Natterer
9baae75c5c Integrate the logic of profile saving with metadata saving
Add flag GIMP_METADATA_SAVE_COLOR_PROFILE to GimpMetadataSaveFlags and
initialize it from gimp_export_color_profile() in
gimp_image_metadata_save_prepare().

Adapt all plug-ins to use the bit from the suggested export flags and
pass the actually used value back to
gimp_image_metadata_save_finish().

This changes no behavior at all but creates hooks on the libgimp side
that are called with the context of an image before and after the
actual export, which might become useful later. Also, consistency
is good even though the color profile is not strictly "metadata".

(cherry picked from commit c667fdc5c0)
2018-12-04 17:40:12 +01:00
Michael Natterer
2f5bbe9416 Issue #701 - Add the ability to embed the GIMP built-in sRGB profile...
...upon exporting an image

Add a "Save color profile" toggle to the PNG dialog and always honor it.

(cherry picked from commit 7ed93452e8)
2018-12-03 13:03:14 +01:00
Ell
5b857dbb4b libgimpcolor, app, modules, plug-ins: remove GEGL_ITERATOR2 define
... it's no longer needed, since GEGL commit
gegl@9dcd2cde63f95a080bf16a58c10e9ffbdd99aace.

Partially reverts commits:

6fca9959c7
cc10af72cc
49c53568d7
8edbc0d491
29f63616d2
3a2014984d
ee48ec6877
4165a315d5
764085278f
b7633c722e
6ab12061b7
754a3c5b18
22b4b647bd
55b3438328
c6d23add65
f03a84d607
822f9f0d2b
95358ca1fa
cdda37f4ee
41e8035635
6761da42b2
fb5d7832a8
97ed7817d8
46e9036578
ea9c5e6a49
24fbdfb591
beb4ecb238
4b77831e03
fcf113a39c
567ffe94ff

(cherry picked from commit 053e5edc93)
2018-12-02 11:21:36 -05:00
Jehan
84ce89a9be Issue #2501: Confusing wording in "Export Image as PDF" dialog.
Nothing said what was going to be the order of the page, except by
testing. Now there will be an explicit text, which will be automatically
updated when checking the "reverse order" box.

(cherry picked from commit afe1de950f)
2018-11-14 13:42:36 +01:00
Jehan
679e341285 Issue #2431: After coloring a selection and exporting to PDF, file...
... only shows the color (and nothing else) when "Convert bitmaps to
vector graphics where possible" was set.

This is because gimp_drawable_histogram() only checks selected pixels.
So let's make sure we work on a duplicate of the image so that we can
safely remove the selection before processing the export.
2018-11-08 15:24:42 +01:00
Jehan
911d3945eb Issue #2160: Exporting to PCX results in a warped file.
Add line data padding when necessary.
Additionally I realize we should convert to little-endian after checking
the bytesperline oddness (this bug was most likely unnoticed until now
as most desktop proc are little endian now anyway).

(cherry picked from commit 5d319b77bf)
2018-11-01 22:24:30 +01:00
Tobias Ellinghaus
7b4577a0e4
file-pnm: Remove clamping when loading PFM files
(cherry picked from commit bfcb7fc593)
2018-10-30 13:38:46 +01:00
Josef Ridky
56c8f8320d Issue #2087 - Issues discovered by coverity scan
Add missing fclose invocations and fix copy-paste issue.

This issues has been discovered by coverity scan proceeded by Red Hat.

Fixed some mistakes in the patch and added more fclose() (Mitch)
2018-10-19 11:24:48 +02:00
Øyvind Kolås
78b81a200a plug-ins: migrate gradient-map to new iterator api
(cherry picked from commit ee48ec6877)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
35713ad1ff plug-ins: migrate qbist to new iterator api
(cherry picked from commit 4165a315d5)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
a123c43a97 plug-ins: migrate file-png to new iterator-api
(cherry picked from commit 764085278f)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
ab1bb27129 plug-ins: compose migrated to new iterator api
(cherry picked from commit b7633c722e)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
8e17056d15 plug-ins: colormap-remap migrated to new iterator api
(cherry picked from commit 6ab12061b7)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
4baf61a2a0 plug-ins: border-average migrated to new iterator api
(cherry picked from commit 754a3c5b18)
2018-09-18 12:36:13 +02:00
Øyvind Kolås
9953fe57d9 plug-ins: decompose migrated to new iterator api
(cherry picked from commit 22b4b647bd)
2018-09-18 12:36:13 +02:00
Jehan
e1cf340515 plug-ins: add the "msf1" brand for HEIF files.
After Dirk Farin had another look in the specs, it turns out that "mif1"
is actually allowed as major brand for HEIF. Also adding "msf1" which is
the equivalent for image sequences.

(cherry picked from commit 64b00b5c7f)
2018-09-16 22:56:07 +02:00
Jehan
e4bff4c801 Issue #2209: more accurate magic for HEIF files.
Just looking for "ftyp" would also match other ISOBMFF files (.mov or
.mp4 files for instance). These are the possible 4-byte "brand" code
which can follow "ftyp", as listed by Dirk Farin from libheif.

I add the "mif1" brand, as I encountered some files using this magic
(even though this should normally not be valid apparently, yet the file
loaded fine in GIMP).

This is not perfect as the standard allows potentially very big box
headers, in which case 8 bytes (the "largesize" slot) may be inserted
between "ftyp" and the brand, as I understand it. But this is actually
unlikely enough to probably never happen (the compatible brands list
would have to be huuuge, as it looks like this is the only extendable
part in a ftyp box). So let's assume this just never happens.

See also: https://github.com/strukturag/libheif/issues/83

(cherry picked from commit 4ad3993eca)
2018-09-16 22:56:07 +02:00
Jehan
e76d0941a9 Issue #2209: HEIF: Invalid input: No 'ftyp' box.
Adding a magic number for HEIC/HEIF, which would allow to discard
obvious non-HEIC images even with the wrong extension.

Note: it looks like this magic number would also match more generically
other ISO base media file format (ISOBMFF) formats, like .mov or .mp4
files. I am enquiring for better magic but for now, this is better than
nothing.

(cherry picked from commit d738d2f645)
2018-09-16 22:55:44 +02:00
Jehan
5682a01626 plug-ins: fix individual install targets of common plug-ins.
The "rule from hell", dixit Mitch. :-)

(cherry picked from commit 2713bc4285)
2018-08-16 13:25:51 +02:00
Jehan
25f099344f plug-ins: make plug-ins inside common/ to also install in subfolders.
(cherry picked from commit d89ad95cc7)
2018-08-16 13:25:51 +02:00
Jehan
c49afa4f84 plug-ins: replace s/printf/g_printf/
When cross-compiling, I got various linking errors for printf() calls:
> undefined reference to `libintl_printf'

I am unsure why, since this is not recent code, and it used to build
fine with mingw64 compilers (last I cross-built, which is many months
ago). Anyway g_printf() works fine, all necessary libs are already
linked, and it is supposed to be a synonym. So let's just go the easy
way and use g_printf() only.
2018-08-12 20:59:48 +02:00
ONO Yoshio
34b54971d8 Fix file-pdf-save exports broken vertical text.
(cherry picked from commit f0e585e7ff)
2018-08-06 12:14:08 +02:00
Michael Natterer
e747cbad6b plug-ins, pdb: remove the unsharp-mask plug-in and add a PDB compat proc
(cherry picked from commit 680642e37c)
2018-07-14 17:15:56 +02:00
Michael Natterer
9e71fc0983 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.

(cherry picked from commit bab75b7365)
2018-07-14 14:23:42 +02:00
Michael Natterer
c4ba9c36a6 Issue #1841 - Export As... mng swaps width and height
layer_cols and layer_rows were swapped.

(cherry picked from commit 44b469e493)
2018-07-13 17:58:28 +02:00
Michael Natterer
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
Michael Natterer
cf80265411 More bugzilla -> gitlab in various files
(cherry picked from commit 8eb77376c4)
2018-07-11 22:26:53 +02:00
Michael Natterer
7a49f59021 plug-ins: need to initialize "name" now in file-pat.c
(cherry picked from commit 34a0c36602)
2018-07-07 10:51:05 +02:00
Michael Natterer
f46cf260c5 Issue #1730 - pat file that crashes gimp-2.10
Introduce GIMP_PATTERN_MAX_SIZE (10000) and GIMP_PATTERN_MAX_NAME (256)
and validate pattern dimensions and pattern name length against them.

Add GIMP_BRUSH_MAX_NAME and validate that too.

Also make sure that the names are properly terminated, and some
cleanup.

(cherry picked from commit 9b56ca8c1d)
2018-07-06 13:11:57 +02:00
Michael Natterer
cd5e1470c9 app, plug-ins: move GIMP_BRUSH_MAX_SIZE to gimpbrush-header.h
and use it in the brush file plug-ins.

(cherry picked from commit 8195a56261)
2018-07-06 13:11:49 +02:00
Michael Natterer
b9272f8b5e app, plug-ins: clean up gimpbrush-header.h and gimppattern-header.h
Namespace the header structs, s/GBRUSH/GIMP_BRUSH/,
s/GPATTERN/GIMP_PATTERN/.

(cherry picked from commit e759ce3558)
2018-07-06 13:11:41 +02:00
Jehan
ee25bfc8bd libgimpbase: add gimp_pixpipe_params_free().
And use it where appropriate. A public API asking you to know the
internals of your code is a bad idea.
2018-06-27 18:37:20 +02:00
Jehan
e96b05beed plug-ins: lookup WMF fonts on same prefix when relocatable bundle.
When ENABLE_RELOCATABLE_RESOURCES is set, override libwmf fontdir. This
is actually an alternate version of MR !9 by Alex Samorukov assuming a
bundled GIMP on a single prefix rather than depending on an environment
variable.
This especially makes the relocatable feature more discoverable (rather
than some random environment variable for which you'd need to read the
code to discover it then make some wrapper script for GIMP).

(cherry picked from commit 4ff856f68d)
2018-06-27 04:40:02 +02:00