Jump to content

link staff images to thir profile


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

Recommended Posts

  • Newbies

Hello

I'm a complete noob, just figured out a little about containers and calculations but don't really understand how to do this... or what the reference path should be.

I have 2000 people in a database

All their details showing up nicely

For most I have a photo for each (in a folder on my computer called "staffpics"

Each photo is titled as "FirstName (space) LastName.jpg", where FirstName and LastName are each fields in the profiles

* I just want their photo to appear when I skip through the profiles.

(extras... would be great if when clicked it opened up the original photo - probably would be bigger. would be great that if a photo didn't exist, it substituted it with a blank image (or one with a caption)

So far some one gave me the advice to have the image as a calculation outputting as a contain with this:

"image:/path/Macintosh HD/Users/Me/staffpics/" & First Name & " " & Last Name & ".jpg"

I am not 100% sure of what to do with this, or what the complete path should be, but I have tried it many many way, and instead of a photo I get a message saying "the file cannot be found: John Smith.jpg"

So it does seam to translate the variables, so maybe I have a path error.

I'm on a mac and I have the .fp7 file in a subfolder of documents, and the staffpics is directly under my name ie. at the same level as documents

Can anyone advise on what they think is going wrong here or if there is another solution, or even if I'm messing up the path.

All help very much appreciated, I have wasted too many hours on this.

Ps. I know that there is a big problem when 2 people have the same name, but for now I am just trying to get this to work. Later I'll have each person with a unique number and their image being number.jpg

Thanks again for any help.

Link to comment
Share on other sites

A couple of questions.

1. Why do you have the word "path" in your file path?

2. For a full path, which this is, you really should use "imagemac:/" (like it shows in the dialog at the bottom).

3. Is your short name really "Me", or are you just not showing it to us?

4. It might be easier to put the folder IN your Document folder, because there's a FileMaker function for that location.

"imagemac:" & Get ( DocumentsPath ) & "staffpics/" & First Name & " " & Last Name & ".jpg"

4.a. Get ( DocumentsPath ) starts with "/" and ends with "/", so you don't need to add them.

5. The result of the calculation is "Container"

Link to comment
Share on other sites

  • Newbies

Thanks Fenton,

You were right on the mark. Appreciate the help.

I just put "path" in there for show, and changed my name to me, but the initial / was a poblem, and also I needed a couple of ../../ in there because I guess it's referenced from the FMP file, I just couldn't remember ../ is to go back up the directory :(

"image:../../staffpics/" & First Name & " " & Last Name & ".jpg"

is what eventually worked. Thanks for your help,

do you have any ideas on the thumbnail question, or replacing the "file not found" text with another blank image... for those without profile pics?

Thx again

Link to comment
Share on other sites

1. It's referenced from the FileMaker file if you use "image:", but not if you use "imagemac:/". The first is a "relative" path, the 2nd an "absolute" path. Look at the bottom of the path dialog box; it shows examples of the path syntax; it's also in the Help. You can use the relative path, with "../../", if that's what you want to do; either syntax will work, if the path is correct.

2. Thumbnails? For List view? You can use FileMaker's "Reduce" Graphic option. But it's kind of a dumb idea; because the full-size image will be loading, then shrinking; double-whammy, slow (depending on size of originals).

You could use a graphics app to create a duplicate folder of the originals, resized to thumbnail size (128? 80?). I have an AppleScript droplet that can do that, if you need it. Or you can run similar from FileMaker, looping thru the records.

Or, easier, if you want a 128 embedded thumb,* you can use FileMaker's Import Folder command, Picture files. It can create a 128 thumb on the fly during the import. (The [x] Reference only is irrelevant in this case, because we're not going to import the Image itself.)

When it gets to the Import dialog. Line up Thumbnail to a Thumb container field. Do NOT import the Image (or file path). Choose the option (lower left), Matching records. Match on File Name (to your First Last.jpg field), by clicking on the arrow again. It will turn to <=>.

Do NOT check "Add new records" (very lower left).

Show All Records first. Best to set this up with a script, as you will need it again, to add Thumbs for new pictures. No need to Show All when just doing a few; just Find the records you want to match.

*You might as well embed the thumb, rather than calculate it, as it will render faster. Either method will work though.

3. The "file not found" is pretty difficult to get rid of. Because FileMaker doesn't know ahead of time that it isn't there; you can't check within the calculation (you can if you have a plug-in with this feature).

An alternative might be to create a nice-looking graphic file, then create duplicates of it, named for the missing people. Then it will show for them. Replace it with a real picture when you get one.

AppleScript could certainly help here. Run in a FileMaker script, in a Perform AppleScript step, it could check if the real file is there; if not, it could duplicate the dummy file, and rename it to the person's name/or/id.

It could also rename all your "named" graphic files to the ID in FileMaker, if/when you want to do that.

Edited by Guest
Link to comment
Share on other sites

This topic is 6126 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
×
×
  • Create New...

Important Information

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