Reading in JPG files from a local directory

36 views
Skip to first unread message

Kevin Zawicki

unread,
Aug 13, 2025, 7:54:08 PMAug 13
to TheDBCommunity

Paradox 10, standalone machine.

Reading in JPG files from a local directory.

I read from file to graphic variable then set undefined graphic on a form to that variable.

As cursor moves down table grid, on record arrive I read and display.

It works.

 

BUT

 

I see this error:

When moving quickly down or up or mouse clicking to change rows.

 

I can slowly move up and down 100s of rows, but holding down to scroll down, about 10-20 in I see this error.

One the error occurs it then occurs for every move after initial error, until a Paradox restart.

 

Seems speed related.

 

Removing the setting of the graphic object showed same issue, so it is on the read from file conversion in rapid succession.

 

I know CDRONV is used with in the Corel Suite to convert, making all graphics to BMPs.

 

I am looking at options.

Convert all JPGs to BMP before reading with outside tool?

Loading JPGs to with in a temp table (making them BMPs) and linking? Scanning a table might have same results.

 

Using an OCX viewer embedded in form?

Some of these jpgs are higher res, although not huge, they are not tiny either.

  

Any thoughts would be appreciated.

 

 

Steven Green

unread,
Aug 13, 2025, 8:06:52 PMAug 13
to 'M.Emmanuel' via TheDBCommunity
can't see the error pic, but it sounds similar to the last issue here.. graphic fields have always been problematic,  paradox really has very little control.. a text field pointing to the jpg file itself is always safer.. and bear in mind, when p10 came out, it was still a world of imp, not jpg

--
You received this message because you are subscribed to the Google Groups "TheDBCommunity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thedbcommunit...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/thedbcommunity/ee2d868f-e3bb-4263-a8b6-7e57a8b4126en%40googlegroups.com.

Kevin Zawicki

unread,
Aug 13, 2025, 10:34:22 PMAug 13
to TheDBCommunity
"a text field pointing to the jpg file itself is always safer.."

Do you mean a hyperlink to open the bitmap externally?
The user needs to see the picture as the navigate.
Message has been deleted

Steven Green

unread,
Aug 13, 2025, 10:51:06 PMAug 13
to 'M.Emmanuel' via TheDBCommunity
if it's a jpg and/or if the graphic field is subject to a lot of editing,  yes I'd find a good way to just call the pic in a separate window.. might not make folks happy, but it's an unfortunate limitation of using a 30 year old system.. I tried to put jpg in a report recently, and gave up and converted to bmp for that, too

TheDBCommunity

unread,
Aug 13, 2025, 10:52:08 PMAug 13
to TheDBCommunity
Wow.  My reply just got auto-deleted!  This serves as a reminder to delete the text that gets automatically quoted unless said text is absolutely essential to your reply.

My guess is that it's multiple file system reads that create the problem - but I could be wrong.  You can test this by creating a 1:1 table line where a new table has just the key and the graphic - you don't want any other fields because such tables are prone to corruption.  Keep backups of the graphics so the table can easily be deleted and recreated - make a script.

You can also, in dev, convert copies of the JPGs to BMP and run a test to see if that resolves the issue - should be easy enough.

Finally, arrive can trigger multiple times for each record arrive depending on containers, so check your code and make sure it's not doing multiple [read file and assign to UIO]s for every record arrive in the TF.

FWIW,
Liz
Message has been deleted

Kevin Zawicki

unread,
Aug 13, 2025, 10:54:01 PMAug 13
to TheDBCommunity
>Finally, arrive can trigger multiple times for each record arrive depending on containers, so check your code and make sure it's not doing multiple [read file and assign to UIO]s for every record arrive in the TF.
hmmm...
I will start testing

On Wednesday, August 13, 2025 at 9:53:09 PM UTC-5 TheDBCommunity wrote:
If you convert the images to BMP in dev, and test it, this will tell you whether it's a file system error, or something else (either the JPG conversion or a leak in the graphic UIO, probably).  My guess is that it's the constant reading from the file system.  I would think a 1:1 table with the images in the second table would resolve any file system issues.  But I wouldn't put anything in the second table other than the key of the first table (which is hopefully a meaningless longInt) and the graphic - since the table with the graphic risks blob corruption.

Does the user really need to see images *as they scroll* or just once they settle on a record?  Because if the latter, then we can probably find some way to manage showing the image without doing it on every arrive.

Finally, arrives can happen multiple times, so you should check that your code isn't firing multiple [read graphic & assign]s for every record in the table.

FWIW,
Liz

TheDBCommunity

unread,
Aug 13, 2025, 10:55:04 PMAug 13
to TheDBCommunity
OK, not auto-deleted - but sent for approval - hello!? I'm the group owner, you idiots!  (Sometimes, you just have to wonder about the people at google.)

Now I'm wondering if someone else's comment got deleted at the time I was posting mine...  Sigh.  Select all and copy before posting, I guess - and yes, remember to delete quoted text.

Liz

Kevin Zawicki

unread,
Aug 28, 2025, 12:45:20 AM (10 days ago) Aug 28
to TheDBCommunity
The arrive action is not the cause.
Reading in a JPG too rapidly seems to be the reason, stepping through row by row slowly seems to work, but that eventually errors and locks up.

Plus (as we know) the JPGs are converted to lower res BMPs, not going to work.

The image must appear on form or screen (maybe out side the app), but must be controlled by the table record.

I am looking at OCXs, maybe emending one on my form.
Maybe embedding a internet browser OCX and pointing to the local URL.

I might try and external viewer, but have it load images live as move through records.

Anyone done anything like that? 
Anyone use the web browser OCX?
Anyone have a free decent image view OCX?
I cannot build one in C# directly as it can't build activeX (?).

Steven Green

unread,
Aug 28, 2025, 9:03:31 AM (10 days ago) Aug 28
to TheDBCommunity
> The image must appear on form or screen (maybe out side the app), but must be controlled by the table record.

35 years later, and we're still having a "biolab demo" discussion :-)

Kevin Zawicki

unread,
Sep 1, 2025, 4:21:16 PM (6 days ago) Sep 1
to TheDBCommunity

I downloaded an image viewer OCX and then registered in Paradox.

It does not show up in the list to add to OCX toolbar.

I tried registering it from desktop folder and system WOW folder, etc.

Any suggestions?  Documentation is vague but it reads as if you can register it from anywhere into Paradox then add to tool bar.

Reply all
Reply to author
Forward
0 new messages