Jump to content

Loading images


This topic is 7673 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

I have a database that has a text field for the location of an image. I also have a container field with the image in it. Currently I have to type in the image name and then load the image into the container. I was wondering if there is anyway to automatically load the picture when the name of the image file was entered? Or conversely to load the image and have the filename entered automatically.

Link to comment
Share on other sites

  • 1 month later...

I have the same problem. I am working with a LARGE FMP 4.0 networked image database (23000 records) that needs JPEG images imported into four container fields per record! In fact, this question is the reason I registered with FM Forums. I have seen one other post elsewhere regarding this matter, but there was no reply to it.

The only idea that I have had so far is to download a macro automation utility and program it to simulate the key commands necessary to copy the image pathname from the record and paste it into the Import Picture dialog box, then move to the next record and repeat. This can make the import process slightly easier, but it still has its problems and is far from worry-free automation.

I have tried the multi-image import feature of the Troi File Plug-In (demo), but it caused FileMaker to crash repeatedly for me.

I love FileMaker, but it makes no sense to me that they have not included an image import feature that is based on the contents of a path field in the software.

Upon browsing the contents of a FM database in a hex editor, you will notice that each FileMaker database INTERNALLY contains the full path (in plain text) to each image. It seems, therefore, like it would be straightforward for FileMaker to create functionality to allow manual editing of the path. (or to copy it from an existing field for that matter)

If anybody has any *cross platform* ideas/solutions to this problem, they would be greatly appreciated.

Link to comment
Share on other sites

quote:

Originally posted by lilcowpoke:

I have the same problem. I am working with a LARGE FMP 4.0 networked image database (23000 records) that needs JPEG images imported into four container fields per record! In fact, this question is the reason I registered with FM Forums. I have seen one other post elsewhere regarding this matter, but there was no reply to it.

The only idea that I have had so far is to download a macro automation utility and program it to simulate the key commands necessary to copy the image pathname from the record and paste it into the Import Picture dialog box, then move to the next record and repeat. This can make the import process slightly easier, but it still has its problems and is far from worry-free automation.

I have tried the multi-image import feature of the Troi File Plug-In (demo), but it caused FileMaker to crash repeatedly for me.

I love FileMaker, but it makes no sense to me that they have not included an image import feature that is based on the contents of a path field in the software.

Filemaker is not alone in its ability to deal with images. I do not know of any other database that handles this in any kind of elegant manner.

Remember to that this is no different from any other type of import. Filemaker needs a specific path to the import file, it will not read the path from a record.

However I have done this kind of thing with Filemaker and basically I used WinBatch to feed the path name to the Import Picture dialog box.

It is tought to get working exactly correct, mostly due to timing issues, but once setup it is a pretty simple procedure.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:CaptKurt@home.com

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

quote:

Originally posted by captkurt:

Filemaker is not alone in its ability to deal with images. I do not know of any other database that handles this in any kind of elegant manner.

Remember to that this is no different from any other type of import. Filemaker needs a specific path to the import file, it will not read the path from a record.


One interesting point that I did not mention in my previous post is that you can edit the path to an image (stored as a reference) in a FileMaker file directly within a hex editor and it WILL update the record's image container the next time you open the FileMaker file.

If manual editing of this value is possible, then should it not be possible to program the functionality (via a plug-in or external program) to edit this value directly in FileMaker, as if it were any other bit of data associated with a FileMaker record?

quote:

However I have done this kind of thing with Filemaker and basically I used WinBatch to feed the path name to the Import Picture dialog box.


I have sucessfully done this kind of automation myself using AIM Keys, but I find it to be a somewhat impractical solution, as it is dependant on the arrangement of the layout you are using to enter into the container field. ie: If the layout changes, the script will run incorrectly.

BTW, it seems as if the problems I was encountering with the multi-image import feature of Troi's File plug-in v.1.2 have been fixed by Troi in the new version (v.2.0). Unfortunately, the Troi plug-in stores the images internally, rather than as a reference, thereby increasing the file size of the database. Troi claims to currently know of no way to store images as a reference. While this is a great option for a small image database, but I have so many images to import, I would easily breach the 2GB file size limit of FileMaker files using this plug-in.

* NOTE: I may have just found a possible solution to the image import problem on the Exporter plug-in page <http://home.earthlink.net/~dougmcl/exporter.html>

Clear Solutions claims that the next release (v.2.0) of their Exporter plug-in will, among other things allow, "[The] Import of dynamically specified image files into container fields, BY REFERENCE or directly." This sounds exactly like what I am looking for, but according to the website, it is not expected to be available until September. Is this the first plug-in developer to promise such a function?

Link to comment
Share on other sites

  • Newbies

I have been successful in making FileMaker load an image by reference, using a script.

The key, however, is AppleScript -- so if you're not using a Mac, this won't work for you.

The "set cell" AppleEvent is a FM event that will set the data of a field in a particular record. The cool thing (?) is that it *always* implies the "reference" option.

However, you can't use "set cell" inside a FM script -- you have to run an AppleScript that contains the "set cell" operation. And since you can't (apparently) send a parameter to an AppleScript, you have to generate the AppleScript code dynamically.

The general gist is that I have a calculation field that puts together the magic AppleScript code for the particular record; this calculation field is then performed via a FM script. Each record will have a customized version of that AppleScript, specific for the image filename for the record.

Yes, this is rather bizarre. But I'll explain in more detail how I did it:

1. Create a container field for the graphic. I called it "thumbnail".

2. Create a text field called "filename" to contain the name of the file. (Actually, in mine, this is a calculation, but I'll describe the former because it's simpler.)

3. Create a calculation field called "import applescript" that results in text, containing:

"tell application ""FileMaker Pro""{P}"

& " set cell ""thumbnail"" of current record to file """ & filename & """{P}"

& "end tell"

(Note that I replaced the paragraph symbols with {P} above -- you'll have to use option-7 to get those. This forces FM to put a carriage-return (newline) into the text.)

4. Create a script called "update thumbnail", containing one operation:

Perform AppleScript ["import applescript"]

(When you create this, click the "Specify" button, then select the "Field Value" thumbnail, and select the "import applescript" field you defined earlier.)

5. Link a button to the "update thumbnail" script, enter a filename in the "filename" field, and try it out.

The downside of this process (besides it being a total hack wink.gif is that every record has a calculated field -- this slows things down a bit and makes the database larger.

john

Link to comment
Share on other sites

This topic is 7673 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.