Another TWAIN fix
"Hermann Josef Hill" <[email protected]>
| Newsgroups | gmane.comp.video.gimp.windows.devel |
|---|---|
| Message-ID | <000301c25dbd$6eab08e0$03f911ac@notebook> |
Hi,
while looking into the TWAIN plugin I was able to fix another problem: the
scanned image was always in the default resolution of GIMP instead of the
scanner resolution. Here comes the output of diff ("diff -u´" format, meant
to apply after my last TWAIN patch):
--- gimp-1.2.4\plug-ins\twain/twain.c Sun Apr 8 16:52:38 2001
+++ GIMP_TWAIN/twain.c Mon Sep 16 12:15:58 2002
@@ -716,7 +716,12 @@
/* Create the GIMP image */
theClientData->image_id = gimp_image_new(imageInfo->ImageWidth,
- imageInfo->ImageLength, imageType);
+ imageInfo->ImageLength, imageType);
+
+ /* set resolution for image */
+ gimp_image_set_resolution(theClientData->image_id,
+ FIX32ToFloat(imageInfo->XResolution),
+ FIX32ToFloat(imageInfo->YResolution));
/* Create a layer */
theClientData->layer_id = gimp_layer_new(theClientData->image_id,
BTW: I tried to contact the author / maintainer of the TWAIN plug-in about
the earlier proposed structural change, but the mail came back with "host
unknown". How do we go on from that?
Regards, Hermann