Home » Developer & Programmer » Forms » Image item clearing and image not loading (Oracle Forms 11g)
Image item clearing and image not loading [message #677903] Mon, 21 October 2019 12:00 Go to next message
bonnie.gregory
Messages: 3
Registered: October 2019
Junior Member
I am attempting to use the read_image_file procedure in Forms to show product images to the user. We store the file name of the images in our database.
It is working for most product pictures, except one picture does not display, however, in 'other' of our developed forms, it 'does' display.
We have a remote directory we use to store all the product files.
All files are *.jpg files.

I am using, in forms, a WHEN-NEW-RECORD-INSTANCE trigger to populate the image for each record.
I have multiple records in the block, however the image is only supposed to display for each record and there is only one instance of the image item for the block.
Please give me some ideas to look for problems and how to potentially solve them.

my command for read_image_file looks like this:
read_image_file(:image_dir||:image_file,'JPG','BLOCK.IMAGE');

Why the picture shows on some of our forms and not on this one, when we are using the same code to call it, I am bumfuzzled. Also why other product images are showing when I go into those records, and this one product does not is also bumfuzzling.

Since I couldn't pull the product in, I attempted to 'clear' the previous image from the image item using:
go_item('BLOCK.IMAGE');
CLEAR_ITEM;

However this isn't doing what I expect either.
I have attempted if not FORMS_SUCCESS then
send a message;
and when others then
send a message;

Neither of these worked either. It's like the form doesn't send back an error when read_image_file doesn't find the picture to display it, or the format of the picture is bad?

Any assistance would be greatly appreciated.

At this point I am thinking there could be an issue with the file to display, or the name of the file, stored in the database column, but wouldn't other forms we have created have the same issue?
Re: Image item clearing and image not loading [message #677904 is a reply to message #677903] Mon, 21 October 2019 14:38 Go to previous messageGo to next message
bonnie.gregory
Messages: 3
Registered: October 2019
Junior Member
I just found out what caused this!
read_image_file must have a bug!
Here's what I did to repair this issue.
I declared variable with data Shocked type 'item'.

v_item item;

then assigned the item the item info using find_item, like this:
v_item := find_item('BLOCK.IMAGE');


Then called read_image_file with the following command:
read_image_file(:image_dir||:image_file,'JPG',v_item);

Then the file in question was brought in to my executable form like a dream!
Wasted 1 1/2 days on this....

So, in retrospect, don't send the block_name.item_name to this procedure EVER!
Always declare an item and assign the item the field you want it to be and use THAT in your read_image_file call!
Shocked
Re: Image item clearing and image not loading [message #677938 is a reply to message #677904] Thu, 24 October 2019 14:57 Go to previous message
bonnie.gregory
Messages: 3
Registered: October 2019
Junior Member
Oh well, this is still not repaired. I believe it has something to do with a non-supported jpg figuration in the file.
I don't know why that previous image started working, whether someone updated the picture file and it's now a format Oracle can display, or whether the item ID retrieval helped.
I am seeing some hints about an ORDImage structure I can add to our installation.
Does anyone have any other ideas?
Previous Topic: Can UTL_HTTP be used in the forms.
Next Topic: localhost
Goto Forum:
  


Current Time: Mon Nov 18 23:07:16 CST 2019