Thanks very much Richard!<br><br>Very interested in the GDK patch - I need to make a patch there too to embed resolution information:<br><a href="https://bugs.edge.launchpad.net/simple-scan/+bug/484616">https://bugs.edge.launchpad.net/simple-scan/+bug/484616</a><br>
<br>I think I need to do the conversion regardless so the preview is displayed correctly.  Thanks for the lcms link.<br><br>--Robert<br><br><div class="gmail_quote">2009/12/21 Richard Hughes <span dir="ltr"><<a href="mailto:hughsient@gmail.com">hughsient@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2009/12/20 Robert Ancell <<a href="mailto:robert.ancell@gmail.com">robert.ancell@gmail.com</a>>:<br>

<div class="im">> I don't know much about color management so my question is:<br>
> - What do I need to do to make Simple Scan work with GNOME Color Manager?<br>
> - Is there a GPL project I can lift some code from?<br>
<br>
</div>Well, first you need to ask gnome-color-manager for a list of suitable<br>
profiles using the DBus interface:<br>
<a href="http://git.gnome.org/browse/gnome-color-manager/plain/src/org.gnome.ColorManager.xml" target="_blank">http://git.gnome.org/browse/gnome-color-manager/plain/src/org.gnome.ColorManager.xml</a><br>
<br>
If you know the device you're using (you probably should) then you can<br>
call GetProfilesForDevice() with the sysfs path, and a list of<br>
profiles will be returned. If more than one profile is returned you<br>
probably need to show it in a combo-box or something, but it would be<br>
quite unusual for more than one profile to be returned. If you get no<br>
results, then it's probably because the user has never assigned a<br>
profile for that device (i.e. there is no a-priori mapping). In this<br>
case you can either default to not doing color conversion yourself, or<br>
instead call the GetProfilesForType() dbus method, using the<br>
type=scanner. This will return a list of profiles that are suitable<br>
for use with scanners.<br>
<br>
Now, when you have a filename of the profile you want to use it's an<br>
easy (!) case of acquiring the image like usual, and then you can<br>
either:<br>
<br>
* Just save the image with an embedded color profile (see bug<br>
<a href="https://bugzilla.gnome.org/show_bug.cgi?id=604610" target="_blank">https://bugzilla.gnome.org/show_bug.cgi?id=604610</a> -- I'm working as<br>
fast as I can on the infrastructure bits)<br>
* Convert the image from device-mapping to something like sRGB using<br>
lcms (there are examples in the lcms tarball)<br>
<br>
I think it's probably best you do the first one, unless you know<br>
you're going to be using the images in a non-color-aware application.<br>
<br>
Anyway, I hope that helps,<br>
<font color="#888888"><br>
Richard.<br>
</font></blockquote></div><br>