After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 335139 - Nikon D70 RAW (NEF) color adjustments don't get stored.
Nikon D70 RAW (NEF) color adjustments don't get stored.
Status: RESOLVED WONTFIX
Product: f-spot
Classification: Other
Component: Editing
CVS
Other Linux
: Normal enhancement
: ---
Assigned To: F-spot maintainers
F-spot maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2006-03-19 17:08 UTC by Jakub Steiner
Modified: 2018-07-12 00:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixes NefFile so it saves, although it will save to a jpg (3.45 KB, patch)
2006-07-04 00:49 UTC, Scott (mc304192)
needs-work Details | Review

Description Jakub Steiner 2006-03-19 17:08:21 UTC
After tweaking color with the "adjust colors" function, I get the follwoing error dialog:

Error saving adjusted photo

Received exception "The requested feature is not implemented." Unable to save photo XY.

I see this is unfinished functionality, but filing this enhancement request to make sure it's not forgotten :)
Comment 1 David Zeuthen (not reading bugmail) 2006-03-25 22:40:21 UTC
I see this with Canon Raw files (.CR2 extension) from my Canon 20D running the 2.0.0 firmware on my camera and the f-spot that comes with Fedora Core (0.1.11-1).

If some f-spot hacker could provide directions on how to fix I'd like to hack on this as it is a showstopper for me (still on iPhoto / PS Elements on my Mac).
Comment 2 Carthik Sharma 2006-05-24 19:33:11 UTC
Note: Originally reported via email to the ubuntu-users mailing list. Bug forwarded from Ubuntu Bug Tracker.

If I import my raw photos from Canon 350D, .CR2 files. Then all goes
well until I try to crop the photo.

Received Exception. "The requested feature is not implemented" Unable
to save photo blah.CR2

I can send you a raw photo if required but they are about 12Mb!

I assume it is failing to save back as a raw photo should it give the
option to save as a jpg?

john

-- System Information:
Debian Release: testing/unstable
  APT prefers dapper-updates
  APT policy: (500, 'dapper-updates'), (500, 'dapper-security'), (500,
'dapper-backports'), (500, 'dapper')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-19-686
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)

Versions of packages f-spot depends on:
ii libc6 2.3.6-0ubuntu15 GNU C Library: Shared libraries an
ii libdbus-1-cil 0.60-6ubuntu6 CLI binding for D-BUS interprocess
ii libexif12 0.6.12-2 library to parse EXIF files
ii libgconf2.0-cil 2.8.2-0ubuntu2 CLI binding for GConf 2.12
ii libglade2.0-cil 2.8.2-0ubuntu2 CLI binding for the Glade librarie
ii libglib2.0-0 2.10.1-0ubuntu2 The GLib library of C routines
ii libglib2.0-cil 2.8.2-0ubuntu2 CLI binding for the GLib utility l
ii libgnome2.0-cil 2.8.2-0ubuntu2 CLI binding for GNOME 2.12
ii libgnomeui-0 2.14.0-0ubuntu1 The GNOME 2 libraries (User Interf
ii libgnomevfs2-0 2.14.0-0ubuntu1 GNOME virtual file-system (runtime
ii libgphoto2-2 2.1.6-5.2ubuntu5 gphoto2 digital camera library
ii libgtk2.0-0 2.8.16-1ubuntu1 The GTK+ graphical user interface
ii libgtk2.0-cil 2.8.2-0ubuntu2 CLI binding for the GTK+ toolkit 2
ii libjpeg62 6b-11 The Independent JPEG Group's JPEG
ii liblcms1 1.13-1 Color management library
ii libmono0 1.1.13.6-0ubuntu1 libraries for the Mono JIT
ii libsqlite0 2.8.16-1 SQLite shared library
ii libsqlite3-0 3.2.8-1 SQLite 3 shared library
ii mono-classlib-1.0 1.1.13.6-0ubuntu1 Mono class library (1.0)
ii mono-jit 1.1.13.6-0ubuntu1 fast CLI JIT/AOT compiler for Mono

Versions of packages f-spot recommends:
pn dcraw <none> (no description available)

-- no debconf information
Comment 3 Scott (mc304192) 2006-07-02 03:30:35 UTC
The Save() method in ImageFile.cs doesn't have any code in it. It just throws a NotImplemented Exception. 

public virtual void Save (Gdk.Pixbuf pixbuf, System.IO.Stream stream)
{ throw new NotImplementedException (); }
Comment 4 Scott (mc304192) 2006-07-02 05:03:07 UTC
(In reply to comment #3)
> The Save() method in ImageFile.cs doesn't have any code in it. It just throws a
> NotImplemented Exception. 
> 
> public virtual void Save (Gdk.Pixbuf pixbuf, System.IO.Stream stream)
> { throw new NotImplementedException (); }
> 

Ok, so I got it work, here are my changes (not a formal patch, and only tested for my use, but maybe of use to someone else):

These changes will allow you to edit colors on a Nikon D50/D70 RAW in f-spot, and it will actually save your changes (it probably breaks other things, I'll try to post fixes as I get time to find bugs with my changes).

***************************
ImageFile.cs
// mc304192: new method sig
// this replaces the throw notimplemented with an implementation
// it saves the image as a jpg, i'm sure there's a better way
// but noone else has stepped up with one :)
public virtual void Save (Gdk.Pixbuf pixbuf, String dest_path)
{				
 Exif.ExifData exif_data = new Exif.ExifData();	
 PixbufUtils.SaveJpeg (pixbuf, dest_path, 100, exif_data);			
}

****************************
Photostore.cs
// have to change the file extension, saving back to a NEF causes problems
private string GetPathForVersionName (string version_name)
{
string name_without_extension = System.IO.Path.GetFileNameWithoutExtension (name);
string extension = System.IO.Path.GetExtension (name);
if (extension.Trim().ToLower() == ".nef") extension = ".jpg"; // mc304192: versions are always JPGs for NEFs

return System.IO.Path.Combine (directory_path,  name_without_extension 
					       + " (" + version_name + ")" + extension);
}

public uint SaveVersion (Gdk.Pixbuf buffer, bool create_version)
{
 ....{snip}

 // mc304192: send in path instead of stream
 img.Save (buffer, version_path);
 // using (Stream stream = File.OpenWrite (version_path)) { img.Save (buffer, stream); }
	
 ....{snip}
}
**************************
Comment 5 Scott (mc304192) 2006-07-02 15:39:51 UTC
(In reply to comment #4)

Ok, so it was late, and the previous post was some pretty bad code. Here's a better fix that fits in line with the current coding:

***********************************************************************
PhotoStore.cs

Changed SaveVersion to call a Save() override that accepts a string
(since the SaveJpeg doesn't seem to accept a stream) if the file to
save is not a Jpg

Changed GetPathForVersionName to change NEF extensions to JPG since
we can't save back to a NEF format, and that's how most editors work
***********************************************************************
public uint SaveVersion (Gdk.Pixbuf buffer, bool create_version)
	{
		uint version = DefaultVersionId;
		ImageFile img = ImageFile.Create (DefaultVersionUri);

		// Always create a version if the source is not a jpeg for now.
		create_version = create_version || !(img is FSpot.JpegFile);

		if (buffer == null)
			throw new ApplicationException ("invalid (null) image");

		if (create_version)
			version = CreateDefaultModifiedVersion (DefaultVersionId, false);

		try {
			string version_path = GetVersionPath (version);
			
			// mc304192: if not jpeg, save new version as jpeg
			if (!(img is FSpot.JpegFile)) { img.Save (buffer, version_path); }
			else
			{
			 	using (Stream stream = File.OpenWrite (version_path)) { img.Save (buffer, stream); }
			}
			FSpot.ThumbnailGenerator.Create (version_path).Dispose ();
			DefaultVersionId = version;
		} catch (System.Exception e) {
			System.Console.WriteLine (e);
			// if (create_version) DeleteVersion (version);
			
			throw e;
		}
		
		return version;
	}


private string GetPathForVersionName (string version_name)
	{
		string name_without_extension = System.IO.Path.GetFileNameWithoutExtension (name);
		string extension = System.IO.Path.GetExtension (name);
		
		// mc304192: versions are always JPGs for NEFs
		if (extension.Trim().ToLower() == ".nef") extension = ".jpg"; 

		return System.IO.Path.Combine (directory_path,  name_without_extension 
					       + " (" + version_name + ")" + extension);
	}

*********************************************************************************
Tiff.cs

Overrode the new Save method from class Photo, NEFs are really TIFFs, and here
we're going to save TIFFs (NEFs) as JPGs
*********************************************************************************
public class TiffFile {
// mc304192: new override
	public override void Save (Gdk.Pixbuf pixbuf, String dest_path)
	{
		Exif.ExifData exif_data = new Exif.ExifData(); 
 		PixbufUtils.SaveJpeg (pixbuf, dest_path, 100, exif_data);        
	}
}

*********************************************************************************
ImageFile.cs

Added a new overload for Save that accepts a string path so we can call SaveJpeg
since it doesn't seem to accept streams
*********************************************************************************
public class Photo {
	//mc304192: new method to override
	public virtual void Save (Gdk.Pixbuf pixbuf, String dest_Path)
	{
		// should be overridden by inheritor
		throw new NotImplementedException ();
	}
}

*************************************************************************
Comment 6 Scott (mc304192) 2006-07-04 00:49:07 UTC
Created attachment 68331 [details] [review]
Fixes NefFile so it saves, although it will save to a jpg

I've never used CVS, so I had to figure out how to make a patch file. So, here it is.

This will allow a user to "adjust" a Nef, and when they click "ok", it saves the changes in a new version. It saves the new version as a jpg, not a nef though. 1, I don't think you can write to a Nef; 2, that's how other graphics apps work.
Comment 7 Thomas PARIS 2006-09-14 21:15:17 UTC
I had a (very) quick look at your patch and it looks like what you're converting to JPEG is the preview embedded in the NEF. Doesn't sound very useful to me.

I think for raw files we'll need a "convert" operation similar to what conversion software like ufraw can offer.
Comment 8 David Juran 2006-09-15 15:25:48 UTC
Or why not just invoking ufraw to do the conversion and color adjustments... 
Comment 9 Larry Ewing 2006-10-06 23:00:57 UTC
Scott. the patch is an interesting solution but we need a mechanism to handle versions that aren't jpegs as well.  The right solution is to redo the way the versioning works and store full path to each versioned item, unfortunately doing that without changing the version table is going to basically be a hack.  We could probably avoid that for the short term little while by adding a creating a method to map a prefered version mime type and extension for all the types we handle (essentially what this patch does but not hard coded to jpeg).


The second part of the problem that is pointed out in comment #7 is that once we can save versions we also need to read the raw data and convert it but I'm not opposed to doing this in stages.
Comment 10 André Klapper 2018-07-12 00:02:13 UTC
F-Spot has moved to https://github.com/f-spot/f-spot/issues

If this Bugzilla ticket is still valid in a recent version of F-Spot, please feel free to post this topic as a ticket in the F-Spot project on GitHub.

Closing this report as WONTFIX as part of Bugzilla Housekeeping as we are planning to shut down GNOME Bugzilla in favor of GNOME Gitlab.