Commit Graph

284 Commits

Author SHA1 Message Date
Michael Natterer e80eaf2524 app: start an image profile API in core/gimpimage-profile.[ch]
add lowlevel functions gimp_image_get,set_icc_profile() which deal
with ICC profiles in a GimpParasite.
2014-03-16 23:50:41 +01:00
Michael Natterer 4fb7fc918a Bug 704896 - pop ups are annoying when opening multiple files...
...from the command line on some platforms/window managers

file_open_from_command_line(): display the progress in the active
display if there is no empty display. This way the progress appears in
the display that was opened from the previous command line argument.
2013-11-20 23:17:40 +01:00
Michael Natterer 697572ccc0 app,libgimp*: fix includes to follow our include policy
- don't include <gdk-pixbuf/gdk-pixbuf.h> in headers in app/
- instead, include it in many .c files instead of <glib-object.h>,
  finally acknowledging the fact that app/ depends on gdk-pixbuf almost
  globally
- fix up includes as if libgimpbase depended in GIO, which it soon will
2013-10-15 01:58:39 +02:00
Jehan c7aa623a55 app: clean out a big bunch of leading tabs.
For some unknown reason, most calls to gimp_message_literal() were
indented with tabs.
2013-09-15 04:59:20 +12:00
Nils Philippsen f232a2bb6f app: simplify finding matching extensions
Use g_slist_find_custom(), g_ascii_strcasecmp() rather than iterating
over lists of extensions, then over single characters again and
comparing the output of g_ascii_tolower().
2013-08-30 11:50:57 +02:00
Massimo Valentini 8a7d5c9d16 app: don't pass NULL to g_object_add_weak_pointer
opening many images from the command line used to print:

(gimp-2.9:): GLib-GObject-CRITICAL **: g_object_add_weak_pointer:
assertion 'G_IS_OBJECT (object)' failed

because only the first finds the empty display
2013-07-05 18:13:46 +02:00
Massimo Valentini 6c62eb2238 app: file_open_from_command_line(): don't access a dangling display pointer
Happens if GIMP is quit while the image is being loaded.
2013-07-04 21:07:20 +02:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Michael Natterer 308431f7b6 Bug 701053 - Opening jpg files from Canon camera displays...
...PNG Description encoding error.

Don't unconditionally display all error messages from thumbnail saving.
Instead, return the error from gimp_imagefile_create_thumbnai()
and gimp_imagefile_save_thumbnail() and display it only if thumbnail
creation was the actual user-intended action (like clicking the preview
in a file dialog). Do not display the error when thumbnailing is just
a side effect of loading/saving an image.
2013-05-26 21:31:06 +02:00
Michael Natterer a484066813 app: fix file magic matching
file_procedure_find(): check all procedures' magics and not the first
precedure's magics #procedures times, sigh.
2013-05-02 20:50:29 +02:00
Michael Natterer e99c0045a2 app: fix saving/loading of .xcf.gz and other compressed XCFs
Make file_utils_uri_get_ext() public and use it instead of
strrchr(uri, '.'). Also add "xz" to the list of matched special cases,
and some cleanup.
2013-05-02 20:05:35 +02:00
Michael Natterer 086793d040 Make it harder to "save" to foo.png.gz or "export" to foo.xcf.gz
Remove plain .gz .bz2 .xz from the extensions the file-compressor
plug-in registers, and make sure is only ends up in "save_procs", so
at least "exporting" to foo.xcf.gz is not possible any longer. With
some effort, one can still "save" to foo.png.gz tho, but it's much
harder now.
2013-02-15 00:01:27 +01:00
Michael Natterer 1ba0cfbf38 Bug 680132 - Unable to 'Save As' over smb share
file_procedure_in_group(): consider "file-uri-save" to be in both the
SAVE and the EXPORT groups.

gimp_plug_in_manager_register_save_handler(): allow a procedure to be
in both "save_procs" and "export_procs".

The logic in the file save/export dialog checks uri prefixes and
extensions just fine, so nothing bad seems to happen from this change,
I hope...
2013-02-13 23:44:36 +01:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer 1bf8eef14f app: support invoking file procs that handle URIs directly
*not* via the file-uri plug-in.
2012-11-17 21:21:32 +01:00
Mukund Sivaraman ccaf6c6a75 app: Modify code to handle xz as well 2012-09-02 04:54:21 +05:30
Michael Natterer 220b28677b Bug 676566 - Window title becomes "Untitled" after exporting without saving
Fix this and other issues more globally by moving the logic that
formats the image's display name into the GimpImage object, and return
the properly formatted name, e.g. "Foo.xcf", or "[Foo] (imported)"
from gimp_image_get_display_name().

Also add gimp_image_get_display_path() which returns the full path
instead. Use the two functions for formatting the image title, and
apply various other fixes that make sure the UI always uses the same
string to identify the image.

Call gimp_object_name_changed() whenever the save/export status
changes, so the image's cached display name and path get cleared.
2012-07-17 22:52:49 +02:00
Michael Natterer afa81b5fbf app: create thumbnails also for imported files, not only for XCFs
file_open_with_proc_and_display(): Use gimp_image_get_any_uri() to
check if the opened file has the same URI as the one passed in so
the logic works for non-XCF too.
2012-07-13 23:50:07 +02:00
Michael Natterer 6b6d39fc64 app: add GimpTileHandlerProjection and use it to validate the projection
as the projection buffer is being read from. Projection performance is
now back at its old speed.
2012-07-05 21:42:26 +02:00
Michael Natterer 39c18e9a48 app: make file_save() aware of the difference between overwrite and export
by having two booleans "export_backward" and "export_forward" in the
api instead of just an "export" one that would destroy the "imported
from" state. This change fixes the state of the "Overwrite" menu item,
so it stays visible until the file got either saved or exported to
another filename.

This also reverts commit a4beeecf2b, so
Ctrl-S is always invokable even if invisible.
2012-05-18 18:57:58 +02:00
Michael Natterer 20f3cba2b6 app: rename gimp_image_base_type() to gimp_image_get_base_type() 2012-05-07 21:57:33 +02:00
Michael Natterer 7610e299ae Use GimpValueArray and GimpParamSpecValueArray
instead of the deprecated stuff from GLib.
2012-05-04 00:51:50 +02:00
Michael Natterer 678255604d app: add a GimpPrecision enum that for now contains GIMP_PRECISION_U8
Add gimp_image_get_precision(), and a "precision" argument to
gimp_babl_format(). Change code accordingly and do some more format
related cleanups.
2012-05-02 17:51:09 +02:00
Michael Natterer 774b6e3c16 app: return a format, not image type from file_open_thumbnail()
create a dummy indexed format if neccessary, which can only be used
for checking with babl_format_is_palette(). Port the rest of
GimpImageFile from GimpImageType to Babl*.
2012-05-02 17:51:03 +02:00
Michael Natterer 056e09a6cb Remove the makefile.msc build system, it is unmaintained since 2008 2011-12-16 15:53:56 +01:00
Michael Natterer 0e901776e6 Bug 664728 - XCF files with only one layer not loading properly
In file_open_with_proc_and_display(), don't use the passed load_proc
(which can be NULL) but the actually used load_proc to determine if
the file was imported.
2011-11-28 01:34:43 +01:00
Mukund Sivaraman 7d083ce457 app: Don't overload head_size with different meanings
The code in file_procedure_find() tries to lazy-open the image file, so
it's not opened if unnecessary. To keep track of whether the image was
opened or not, it overrides head_size to keep track of this. head_size
is also assigned the return value of fread() in the loop. The patch
separates this by introducing another variable.

I think it's best to move the file opening code outside the while loop,
as it's most likely bound to be opened anyway, and the penalty is not
too bad.
2011-10-02 18:42:16 +05:30
Michael Natterer a75a9d9469 app: when opening an image, don't unref it if no display could be created
we normally do this because the initial display takes ownership of the
newly created image, but in no-interface mode we would simply unref
the image away, which is bad.
2011-05-17 14:55:57 +02:00
Martin Nordholts a8f552da2f Bug 646371 - The wrong file gets saved when exporting with overwrite
An image can not be considered both exported and imported at the same
time, so stop consider it as imported after we consider it exported.

Also add an automatic regression test.
2011-04-03 16:54:34 +02:00
Michael Natterer 02477f5563 Bug 625167 - Problem exporting floating selections from within layer groups
Add "gboolean merge_active_group" to gimp_image_merge_visible_layers()
and pass FALSE from the PDB wrapper so plug-in invoked layer merging
always acts on the toplevel container as it did in 2.6. Do the same
when opening an image as layer.

Also, added a "Merge within active group only" toggle to the merge
layers dialog and pass it down to the core, but default to TRUE here
so.
2011-02-14 09:45:59 +01:00
Michael Natterer a12af14a59 app: don't forget to free the layer's new name 2011-02-07 00:52:34 +01:00
Michael Natterer 0d2de3e7c1 app: don't gimp_object_set_name() on the image's layer after opening
Instead, use gimp_item_rename(). Also change the name before creating
a display for the image, to avoid confusing the undo dialog.
2011-02-07 00:50:54 +01:00
Martin Nordholts 6c6cf7a881 app: Move import and export URI updates to file_save()
We should handle import-URI and export-URI at a lower level so
e.g. the import URI is reset when gimp_dnd_xds_save_image() is
used.

This change also simplifies unit testing.
2011-02-02 22:31:27 +01:00
Martin Nordholts 6ea36f3383 app: Use gimp_image_set_uri()
I forgot to do this...
2011-02-02 22:28:47 +01:00
Martin Nordholts 366cddc856 app: gimp_image_get/set_imported/exported/save_a_copy_uri()
Add more proper core API for GimpImage URI management.
2011-02-02 22:28:46 +01:00
Martin Nordholts 8d61a61c0e app: Remove GIMP_FILE_EXPORT_TO_URI_KEY
Remove GIMP_FILE_EXPORT_TO_URI_KEY which is always identical to
GIMP_FILE_EXPORT_URI_KEY.
2011-02-02 22:28:46 +01:00
Martin Nordholts 480d6e0cf2 app: Add and use gimp_image_get_uri() 2011-01-26 08:19:39 +01:00
Martin Nordholts ac773489e4 app: gimp_image_get_uri() -> gimp_image_get_uri_or_untitled() 2011-01-26 07:55:14 +01:00
Michael Natterer 4211524ee2 Use gimp_image_undo_is_enabled() instead of private->undo_freeze_count 2010-02-05 09:19:43 +01:00
Michael Natterer f769284aca Start private struct for GimpImage and move the first members there 2010-02-03 20:31:25 +01:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +02:00
Martin Nordholts 957cf2cfa9 app: Always use gimp_object_get_name()
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
2009-08-29 12:41:29 +02:00
Michael Natterer d442379d5e Change GimpProjectable::update to GimpProjectable:invalidate
The only purpose of this change is to avoid having the "update"
signal twice on GimpGroupLayer (from GimpDrawable and from
GimpProjectable). Switch back to normal g_signal_connect()
in the projection.
2009-08-26 13:06:55 +02:00
Martin Nordholts ee8b53934b app: Use original layer names when importing multi-layered images
We have no reason to believe that the original layer names when
importing multi-layered images are not good enough, so stop adding the
filename as a prefix to the names.
2009-08-22 10:34:15 +02:00
Martin Nordholts b574ae9275 app: Name layers of imported files to filename
After having imported a single-layered image, rename the layer to the
file name.
2009-08-22 10:24:53 +02:00
Martin Nordholts 92df6ae6cd app: Introduce helper function file_open_get_layers() 2009-08-22 09:00:18 +02:00
Martin Nordholts 04349c8878 app: Put gimp-file.h in file/Makefile.am 2009-07-12 12:48:06 +02:00
Martin Nordholts 1662ff2523 app: Keep track of GimpImage export dirtiness
Since save and export are separate activities we need to keep track of
image dirtiness for both of them. For this purpose, add a
'export_dirty' member to GimpImage which has the same semantics as
'dirty', but for export. Set it to clean whenever a document is
exported by whatever means. Do this with a new function
gimp_image_export_clean_all(). Also add gimp_image_is_export_dirty().
2009-07-05 09:28:52 +02:00
Martin Nordholts 8a1e826d99 app: Show "Overwrite <filename>" in File menu
With no export target but with an import source, show
"Overwrite <filename>" in the File menu. This also means we can't set
GIMP_FILE_EXPORT_TO_URI_KEY along with import source any longer.
2009-07-02 22:17:36 +02:00