Newbies jwoody35 Posted October 21, 2008 Newbies Posted October 21, 2008 Hello: I’m trying to Configure a container field to accept a file path to a jpeg from a text field, and then to display it as a picture in the container box. I have been able to get the container field accept a path through a calculated value using GetAsText (FieldName), and to display the jpeg as a file (which can be opened or exported), but it will not display as an inserted picture. Ultimately I need to automate the insertion of pictures via database generated file paths. Exmp: file:/Macintosh HD/Users/jon/Desktop/Shapes/pic3.jpg is entered in “field_1” pic3.jpg displays as a lovely little picture in container field “field_2” – provided of course that the file exists in that path. Would also like that container file to update if the picture “pic3_jpg” changes is replaced with a different picture with the same name. Thanks for any insight JW
Vaughan Posted October 21, 2008 Posted October 21, 2008 (edited) "Ultimately I need to automate the insertion of pictures via database generated file paths." I think you'll have to script the process: use the file path in a text field to import the image. "Would also like that container file to update if the picture “pic3_jpg” changes is replaced with a different picture with the same name." Well, for that I'd leave the images as references and not store them in the database. Edited October 21, 2008 by Guest
FMReader Posted November 1, 2008 Posted November 1, 2008 I have a similar situation. I have a hard drive full of images (12,000 and growing). I have a database in which each entry has eight picture containers (different views of the same object stored as jpg files go here). The serial number in the database matches the filename on the big hard drive, so it was straightforward to create a calculation to create the entire filepath to the files. Now I need FMP9 to match them up. I thought it would be as straightforward as putting the filepath calculation in each container definition when I created the pic containers. I expected to see a thumbnail in the container as I paged through the database entries in browse mode. But the containers are still blank. I've verified that the filepath calc is correct and the files are there and there's no problem inserting the images manually either in toto or by reference. Is there another way to associate a filename with a container and have it automatically link to the pic by reference when you access that record? A script was mentioned, but is a script necessary if the filepath can be generated quite simply in the container definition or am I missing something?
comment Posted November 1, 2008 Posted November 1, 2008 Most likely the calculated path is incorrect. I'd suggest you make this test: 1. Insert one of the images into a container field as reference. 2. Define a calculation field (result is Text) = GetAsText ( ContainerField ) 3. Observe the absolute path as it appears in this calculation field (the absolute path will be the last line in the text), and make sure your own calculation returns exactly the same thing.
FMReader Posted November 1, 2008 Posted November 1, 2008 (edited) Thanks for your quick response. I did the manual insert to a container plus the calc and had this discrepancy: My calculated path - History:/Level1/Level2/Filename.jpg The referenced path - imagemac:/History/Level1/Level2/Filename.jpg So I fixed the calculation so the result matches the referenced path of the manually inserted pic exactly (by the way, the forum software is inserting those extra spaces, so assume they are not there in the filepath). Thanks. Unfortunately, I'm still not seeing pictures and I've been careful to deselect the checkbox "Do not replace existing ..." so that it calculates dynamically. Is something else necessary to get filemaker to display the image by reference? Edited November 1, 2008 by Guest
comment Posted November 1, 2008 Posted November 1, 2008 (edited) Try using a calculation field with the result set to Container - NOT a container field with auto-entered calculated value. The calculation field should be set to unstored in Storage options. Edited November 1, 2008 by Guest
FMReader Posted November 10, 2008 Posted November 10, 2008 Hi, sorry I've been slow to report back on this, but life became unexpectedly busy(er). Okay, thanks for all the suggestions that helped point me in the right direction. I found that it is possible to create a calculation directly in the container definition, as long as result (filename calc) is set to container. This allows me to generate the filenames on the fly, based on information for that record (serial number) and to correctly find and automatically update the images. That's great. I also wrote a simple script that will go through and change all (in case the entire image base changes) so it's not necessary to manually page through each listing. That covers both needs (individual record update and all records update). However, I have run across a strange "feature" in Filemaker. It inserts some of the pictures sideways! WHY? This is totally unacceptable for my app, the files have to display as they are (they are in portrait orientation and display fine in Graphic Converter, Photoshop, Preview and every other app). I tried changing the proportions of the container box, but that didn't make a difference and I shouldn't have to do that anyway. Any ideas as to why Filemaker would rotate some of the pictures (about 25% of them) 90 degrees clockwise? I'm baffled.
comment Posted November 10, 2008 Posted November 10, 2008 Sounds like Filemaker doesn't read (or doesn't understand) some of the image EXIF data. I'm afraid I don't know much about that. Perhaps you could add a flag field to indicate that the image needs to be rotated, and TWO calculation fields overlaid on the layout - one normal, and one rotated.
Recommended Posts
This topic is 5917 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now