Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jan-Erik Lärka

Pages: [1] 2 3 ... 19
1
Hello,

Would like to see that AOO look like something found in OS/2 applications.

The current/default/available can be found as .zip-files in ...\OpenOffice\share\config
as images.zip, images_brand.zip, images_classic.zip, images_hicontrast.zip and images_industrial.zip
in png format of 16x16 and 26x26 pixels, would be nice if one could use 16x16 & 32x32 or 20x20 & 40x40 instead, but as of now one can specify small/large and a scaling factor in AOO.

Regards,
Jan-Erik

2
Applications / Re: PMInSANE :-P
« on: December 28, 2024, 11:32:51 am »
Hello everyody,

Best wishes for 2025 in advanced.
Just a thought why do we not use:
https://www.os2world.com/wiki/index.php/Tame/2
I seem to recall its possible to add scanners to this project ?
Or have I overlooked something ?

Roderick

Thank you, and the best of wishes to you as well.

Tame/2 is the most complete package out there, but why "add scanners"?
SANE at the time apparently didn't list found/attached scanner(s), nor their capabilities, right?
So that information had to be assembled into scanner.dat (see image)
Since a long time ago scanimage have had the capalibity to list attached/found scanners and their capablilites as it seem to me. Detection may have been easier on LapTops than on Workstations, but improved with later versions, though sigsegv appear with recent versions.

It wasn't always easy to find out how to state the settings to run scanimage, that has changed over the years, but the auto detection and listing improved things, if one was brave enough to run it on the command line.

This thread confirm that it is possible to do automatic detection of the scanner information and capabilities. It also indicate that I'm not alone to see one file output image format and crop issue aint isolated to my setup/equipment here.

In 2018 I had to look for something that could make it run with my workstation, but there where none. Looked at the project sane2twain that would be nice to combine, but it relied on a tweaked and specific version library that wouldn't allow updates easily.

I do dislike (think of a stronger series of words and curses) compiler specific calling conventions and versions that restrict updates of libraries. Things depending on libraries should be able to use whatever version is available, perhaps nag about it and mention the lack of capabilities, but not require a specific version to the second decimal. So I looked at writing my own, and did rewrite scanimage to the point where it output image data as pnm with defaults. I even bridged problems with calling conventions to some extent, but was unable to continue as my openwatcom compiled code at a late stage could not adjust/get the actual numbers for some setting in a gcc generated library. No I don't do gcc. (period)

Another possibility was to create a generic* library that would run the available scanimage.exe asyncrounously and control its output as it run. I still need more information how to create something that can both work with java.exe, sqlite3.exe and scanimage.exe etc. thus redirect, use and not block stdin, stdout and stderr.

One can of course use
scanimage -parameter|RXQUEUE
as in this specific case* as it doesn't require input on the command line, threaded as this to get output and progress as it appear.

*It has to be useful in more than with just one specific situation, version or application... reread the section about dislike for version specific libraries above!

3
Applications / Re: PMInSANE :-P
« on: December 26, 2024, 09:44:42 am »
...oh, one more thing:

...The backend here can't produce anything else but PNM (PPM) so the library convert the files to above file formats (and BMP that the viewer need)...

1.0.28 sane here and "--format tiff" creates the TIFF stuff, which is consistent with what I see on the SANE man page here => http://www.sane-project.org/man/scanimage.1.html:

Code: [Select]
--format=output-format
              selects how image data is written to standard output or the file
              specified by the --output-file  option.   output-format  can  be
              pnm,  tiff,  png, or jpeg.  If --format is not specified, PNM is
              written by default.

I suspect you have an opportunity here to just use the scanimage out-of-the-box functionality...can't speak for 1.0.27 though...maybe that's the difference you are seeing, as I am not familiar with prior versions???

All versions that actually do something useful output pnm (see PPM in the image) only, so the safe route is to go with what is available and work from there.
I've used the parameter and the versions tested do output files, but when examined the internal file format written is still pnm.
The extension thus deviate from the actual data format it report, open a file with PMView by hand and see if it really is of the file format it pretend to be.
The conversion library rxImgSze has been designed to report such problems but not work with those, unless manually fixed.

I consider 1.0.28 to not work... it does nothing here but sigsegv when used with parameters needed to determine the scanner and its capabilities.

4
Applications / Re: PMInSANE :-P
« on: December 26, 2024, 09:24:35 am »
Hello Jan-Erik,

Here's and updated version that create output as TIFF, PNG and JPEG, specify "-FMT TIFF", "-FMT PNG" or -FMT JPEG" as parameter to set the output format.
The backend here can't produce anything else but PNM (PPM) so the library convert the files to above file formats (and BMP that the viewer need).

Hmm...not sure what's happened but this verison won't fire up PMView anymore, can I do anyting to troubleshoot this further?

I did delete the App Key from OS2.INI thinking that maybe there was something there confusing it (verison change, etc....just guessing on my part), but that did nothing.
You were quite right.
Added and renumbered the controls, but missed a couple of places that caused it. See attached and updated package.
Hi Jan-Erik

The "Crop" problem Dariusz reports could be the result of the differences between an OS/2 screen and every other pc os screen - OS2/2 starts at Bottom Left as 0,0 whereas Windows, linux etc start at TOP Left as 0,0.

Pete

Here crop produce the output I expect, x to the side and y pixels down, but at times sane or the backend fail to recognize the width.
Can't do much unless sane handle the parameters.

When attempting to do a CROP the little pop-up measuring fields never pop up here, just a LMB down starts a BLUE line, keeping LMB down and dragging it over and releasing now converts that BLUE line into GREEN and creates a NEW BLUE line to close the CROP box I had created.

I've got to tell ya, that's very counter-inuitive for me, but that's just me being used to a dynamically dragged CROP box. I suspect this may have a lot do to with DrRexx stuff seeing as the CROP fields themselves are missing as well?

Also, tried the Program Ojbect parameter passing, nothing, and absolutely nothing I did worked.

Click the button to show the values for crop... (see image with the bubble help).
RMB clear crop area selection btw.

5
Applications / Re: PMInSANE :-P
« on: December 25, 2024, 12:01:21 pm »
Hello,

I really like your HPScan, it is an inspiration and clean and efficient interface to the user.
If one can set a parameter like /Sin=PMV123 and the file to the viewer, it can hand over the image to PMView without starting a new instance.
Envy those who develop with WDSybil, seem to contain so much more controls than other tools.

Hi Dariusz

Maybe HPscan would be worth a try http://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/apps/graphics/scan/HPscan_1-00.zip


Regards

Pete

6
Applications / Re: PMInSANE :-P
« on: December 25, 2024, 11:54:06 am »
Hello,

Here's and updated version that create output as TIFF, PNG and JPEG, specify "-FMT TIFF", "-FMT PNG" or -FMT JPEG" as parameter to set the output format.
The backend here can't produce anything else but PNM (PPM) so the library convert the files to above file formats (and BMP that the viewer need).

Have also included a little app that use PMInSANE to get only a portion of the area and also need gocr.
Here in Sweden payments go through BankGiro or PostalGiro, that use the font "OcrB" (Bold) at the bottom part of the paper.
The payment number use Luhn calculation to ensure that the numbers are correct, and such a calculation is included in the app.
If the preceeding number doesn't add upp, the information show in red text (__ should have been 14 or 41 depending on ...).
The gray areas should show a clipboard like button, but it has to be improved to show up properly.

Hi Jan-Erik

The "Crop" problem Dariusz reports could be the result of the differences between an OS/2 screen and every other pc os screen - OS2/2 starts at Bottom Left as 0,0 whereas Windows, linux etc start at TOP Left as 0,0.


Regards

Pete

Here crop produce the output I expect, x to the side and y pixels down, but at times sane or the backend fail to recognize the width.
Can't do much unless sane handle the parameters.

7
Applications / Re: PMInSANE :-P
« on: December 21, 2024, 09:45:34 am »
Hello Jan-Erik!

The visual artefacts appear here as well. it's part of DrDialog but resolv if you adjusst the window size >>>>slightly<<<< so that it can recalculate the position of controls and reposition/redraw them.

Yup, and honestly these are tiny things, so easy to deal with.

I'm adding code to set the(same)  resource id after it has resized to allow it to redraw and hope that it will improve things for most cases.

OK good stuff, this is working well.

So can I 'push my luck" some more??? LOL

How about the other additional feature request:

1) could we add the file format choice?
I prefer to save my old Auto Parts Books scans in TIFF and optionally do some post processing on these in PMView, etc.

I'm looking in to that.

BUG REPORT
=========

1) CROP function, in my case the crop is incorrect, meaning the wrong part of the image is cropped. Take a look please at the attachments.

Have you seen the little button that should resemble a ruler (1...2] to the left?
Click on it and entry fields appear (though sometimes not fully visible).
That's the numbers (in mm) that it send to sane, and visible in the title bar during scan.
I suspect that sane ignore them, or that this backend perhaps require other parameters?
PMInSANE currently query the found scanner for information as it launch.
'@scanimage -h -d' device '|RXQUEUE'
and determine vertical range with
PARSE VALUE tmp WITH '-t'nt'..'xt'mm'
can you send me the output of:
'@scanimage -h +-d' device '>scan.log'

2) DEVICE select doesn't work: using "-DEVICE hp:libusb:003:001" in the program object parameter field results in that initial pop-up progress window just being blank, and any scanner commands afterwards do not produce any results

Yes, as you override the procedure to query the scanner, it doesn't show "progress", just pop up the main window when ready.
It just pass the parameter on to scanimage.exe and here it (scanimage.exe) hummmm and cause the scanner to scan, but I only have this one.
But scanimage doesn't even start as you add the parameter? I've only seen that scanimage refuse to do anything (just stall) in combination with chkdisk and had to restart the computer and use scanimage before chkdisk.

EDIT => nope, turns out that passing ANY parameters causes the outcome I wrote above, it is not just the '-DEVICE' one which I initially thought...passing '-O Y:\tmp' (which is my RAMDISK) produces the same result.
Strange, restart the computer and try again  ;D
Here it scanimage send the output to -O C:\var\temp\
Note the trailing \ try that as well

Is it possible to write tmp.pnm on Y: as the parameter you've set suggest?
and Y:\tmp.pnm isn't blocked?

8
Applications / Re: PMInSANE :-P
« on: December 19, 2024, 10:16:59 am »
The visual artefacts appear here as well. it's part of DrDialog but resolv if you adjusst the window size >>>>slightly<<<< so that it can recalculate the position of controls and reposition/redraw them.



9
Hardware / Re: Epson L4150 Scanner - USB
« on: December 18, 2024, 10:36:32 pm »
1.0.28 does't work for me either, libc panic, while 1.0.27 do work, but I had to download an additional library that output large amount of debug messages. I use it with PMInSANE that also work with the one included with tame.

10
Applications / Re: PMInSANE :-P
« on: December 18, 2024, 09:38:27 pm »
Hello,

here's a new version that should address the needs mentioned so far.

1. Tooltip now disabled by default  ( Activate with a button )
2. The Scanned image can open in one instance PMView ( Activate with a button )
3. "Crash" occured during close if no Color was selected.

Note!
Click the button to the left of Preview to see the fields with numbers to adjust the cropping area.

11
Applications / Re: PMInSANE :-P
« on: December 17, 2024, 07:34:28 am »
Jan-Erik!

Very cool...I do quite a bit of scanning on my HP 6390C scanner (automotive hobby and so many VERY LARGE parts books to digitize LOL), so this is very handy indeed.

In fact, I had previously written a REXX script which allowed me to basically pass various parameters to drive the scanner with. All of my post-processing is then done in PMView which is called automatically once the scanner job completes.

What I particularly love about your approach is the abiility to do a quick assessment (Preview, yes?) and immediate cropping of the interested area!!!

OK, so from a feedback perspective (where I hope you do not object to the "umm, can we made this better?" parts):

1) Your app recognized my HP ScanJet 6390C (63X0C, Model C7670A, Rev=3945) scanner w/o any problems...it is USB aattached and currently working with, NICE!

2) I have WPS set to auto-focus and move cursor to pop-up windows/buttons (centering over them) and your handy pop-up 'Help' buttons cause my cursor to immediately get re-positioned over them, which honestly makes trying to use the app very hard

3) Any chance to create a 'Settings' page where perhaps some of the stuff (like the pop-ups) could be turned ON/OFF?

4) Any chance to account for:
- dynamic file creation filename
- passing the file to another app like PMView
- file image choice: JPEG, TIFF, BMP, etc

Alright...that's all, the effort is greatly appreciated, so Thank You!!!

-Dariusz

BTW: I had a couple of crashes, are you interested in seeing these?

I'd like to see the crashes.

I understand your point regarding autofocus, now that you mention it.
I'll have to think about how to do it, as the bubble help use a hidden input field to get triggered.
It should be doable with a setting, a nice Christmas task to turn autofocus on and off.

The library rxImgSze depend on the version of GBM installed. Ensure you have a recent version (GBM 1.77), and it can convert between formats.
-O redirect the output and the file name depend on if you specify a \ last or not and if it is a folder name.

If PMView could call this app it would alse be able to grab the output (though as pnm or bmp at present)

I've created another app that use this one to scan invoices (Swedish) ocr the output and then calculate the check sum to verify the invoice information.

12
Applications / PMInSANE :-P
« on: December 16, 2024, 08:58:30 pm »
I've put togheter this GUI application... nothing fancy, but fun.
It just work and scan stuff on my CanoScan LiDE 25 on both my laptop and workstation with SANE 1.0.27 from Paul Smedley.

Possible parameters with examples/alternatives/info:
-DEVICE plustek:libusb:001:001   (Force the use of a certain device)
-MODE Color                 ( BW, 8G, RGB, Color, ... )
-UNIT cm                       ( mm, cm, inch )
-DPI 300                        ( 75, 150, 300, 600, ... )
-O  C:\Temp                   ( C:\Temp\MyScannedImage )
-AREA 10 10 50 50       ( Left Top X Y )
-BATCH                         (Run in batch mode and return after scan)

13
Programming / ooRexx to control GhostScript
« on: October 14, 2024, 06:37:59 pm »
Hello,

here's a "library" and the script (rename pdf.txt to pdf.cls and TestPDFLib.txt to TestPDFLib.rex ) to use it.
The script should run on win, *nix and os2, but seem to fail on the latter for some functionality.

Note that you may have to tweak ooRexx rexxsetenv.cmd to even be able to access GhostScript.
Run with:
Code: [Select]
rexx TestPDFLib
One can of course write code to do these things in classic rexx, object rexx and plain command line as well,
but the interesting part here is that it should be reusable (not possible with classic rexx).
With some adjustment it should work with Object Rexx as well.

It can be used to merge separate PDF-files, but example of that is not included.


14
Programming / Re: Classic, Regina, Object and Open Object Rexx
« on: October 06, 2024, 10:31:01 am »
NetRexx
  • The last version that ran with our Java (1.)6 was 3.04, as they then compiled it to require features introduced with Java (1.)8 in later NetRexx versions
  • I understand that NetRexx create byte code that the java engine run, but with the additions of Rexx like libraries that add useful features that resemble Rexx.
  • It claim to be like Rexx, but due to the underlying requirement to follow a ceratin structure the code one can write, need to have a certain structure that I don't recognize from Rexx.

Consensus was that Object Rexx for OS/2 wasn't good enough (good features, but bad memory handling, speed and stability due to the complier used), thus not set as default.

WPS integration
Both IBM Classic Rexx (crexx from now on) and IBM Object Rexx (orexx from now on) is integrated with the system, that's why you need to switch rexx interpreter with the command SWITCHRX (see the code of SWITCHRX.CMD in your OS2-folder) that aslo reregister files such as
REXXSC.DLL
OREXXSC.DLL
REXXSOM.DLL
OREXXSOM.DLL
REXXWPS.DLL
OREXXWPS.DLL
that enable crexx  and orexx to be the scripting engine for applications as well as talk to the wps through SOM etc. etc. that interact with the scripting engine to launch it from command line without first typing a scripitng engine name such as rexx <script_to_run.ext>. Guess DB2 intergation and other rexx enabled applications use the currently enabled scripting engine.

When I talk about WPS integration I also mean the programming interface "rexxsaa", not just SOM or WPS.
Code: [Select]
/*
 * Filename: dbug.cpp
 *   Author: JanErik
 *  Created: Sun Oct  6 2024
 *  Purpose: Compile into dbug.exe and debug "it" with Watcom Visual Debugger (wdw) to correct libraries (dll:s) you write for rexx (see unimix rexx .dll)
 *  Changes:
 */
#define INCL_REXXSAA
#include <rexxsaa.h>
#include <iostream.h>

int main(int args, char *argn[]) {
  LONG      return_code;                 /* interpreter return code    */
  RXSTRING  argv[1];                     /* program argument string    */
  RXSTRING  retstr;                      /* program return value       */
  SHORT     rc;                          /* converted return code      */
  CHAR      return_buffer[250];          /* returned buffer            */
                                     /* build the argument string  */
  CHAR      retval[1];
  retval[0] = '\0';

  if( args > 2 ) {
    MAKERXSTRING( argv[0], argn[1], strlen( argn[1] ) );
  } else {
    MAKERXSTRING( argv[0], retval, strlen( retval ) );
  }
                                       /* set up default return      */
  MAKERXSTRING(retstr, return_buffer, sizeof(return_buffer));
  return_code = RexxStart(args,           /* one argument               */
                          argv,        /* argument array             */
                          argn[1], /* REXX procedure name        */
                          NULL,        /* use disk version           */
                          NULL,    /* default address name       */
                          RXCOMMAND,   /* calling as a subcommand    */
                          NULL,        /* no exits used              */
                          &rc,         /* converted return code      */
                          &retstr);    /* returned result            */
                                       /* process return value       */
                                       /* need to return storage?    */
  if (RXSTRPTR(retstr) != return_buffer)
    DosFreeMem(RXSTRPTR(retstr));      /* release the RXSTRING       */

  return 0;
}

There's a nifty script by Steven Levine out there that can enable one or the other on the fly, but then one can't rely on that a certain is enabled but has to fall back to always has to assume crexx to start with.  >:(
crexx is not aware of any of the new features, so with it still the default it is not really useful.

15
Programming / Classic, Regina, Object and Open Object Rexx
« on: October 01, 2024, 06:58:57 pm »
I see that the knowledge of REXX is somewhat limited even with OS/2 users.

Classic Rexx (by IBM) is the default scripting language in OS/2, eComStation and ArcaOS and one just need a simple text editor and write in fairly plain English.
It allow you as a user to write scripts to aid you with certain tasks and it is well integrated with the system so that you don't need to specify an executable to run a script, but it also drive applications as the "engine" written with for example DrDialog, VX-REXX and even code you can write yourself and compile.
It is not possible to create reusable text libraries of code to just call, but one can write functions in the script that perform certain tasks. It's is however possible to use external compiled libraries.

Regina Rexx (by Mark Hessling) is more modern, very similar to Classic Rexx, but lack the system integration.
It is more up to date than Classic Rexx and probably also somewhat more reliable.

Object Rexx (by IBM) addressed some of the shortcomings of Classic Rexx, and on can switch to it in OS/2, eComStation and ArcaOS, while the way to write code also evolved and introduced ~ and arrays with [] but also external reusable code libraries, written in plain text Object Rexx.
Object Rexx is just as well integrated with the base OS as Classic Rexx, can run and use Classic Rexx scripts end external compiled libraries and be the engine for DrDialog, VX-REXX etc., but was never set as default due to that the OS/2 version had some flaws caused by the compiler used, if I remember correctly.

Open Object Rexx (by RexxLA)
has refined what IBM created with Object Rexx and also cleaned up some syntax and introduced a lot of useful and powerful stuff. We now have an up to date and current ooRexx back ported to OS/2 but the integration found in Classic Rexx and Object Rexx is missing so DrDialog, VX-REXX etc. can not benefit from the new features, easier and simpler way to express complicated information and relations etc. but still need to rely on those old scripting engines to be present. If we'd have the intergration Classic Rexx and Object Rexx could be phased out in favor of the new and open version. What we need is what I express as the integration part and that it can run in any command line environment, not only 4OS2.

So what can one do with REXX you wonder?
Alex Taylor has for example written some excellent software that you may have used, both command line scripts and GUI applications like Naps and ANPM to mention a few.
Glassman wrote AutoWGet that is very helpful to fetch things from the internet
and much more...

I use ooRexx to automatically create documents with maps to send to owners of land at work, drive office applications, vector drawing applications such as OpenOffice Draw, Calc etc. split/merge/extract text PDF documents with GhostScript and retrieve routes from google between places etc.

I would like to get your attention to push for an update to the wps integration stuff and enable it for ooRexx on OS/2, without reinventing the wheel from scratch.
The problem is that IBM have a cross licensing agreement with another party (Amiga)?!

Pages: [1] 2 3 ... 19