Jump to content
Sign in to follow this  
DanBrill

Finding Missing Pictures

Recommended Posts

I have a container field of picures. The actual picture is not stored -- just the path name pointing to a jpeg on a network drive. If the picture is deleted, the container field shows a message "The File Cannot Be Found: PicName.jpg"

I'd like to find the records where the links are missing so I can delete the record. How can I find them? IsEmpty() doesn't work -- it still thinks something is in there. GetAsText(ContainerField) still shows the pathname to the file, despite the fact that it isn't there.

Any ideas on how to clean these up?

Thanks,

Dan

Share this post


Link to post
Share on other sites

IsValid() ?

Share this post


Link to post
Share on other sites

Nope. IsValid() gives everything a 1. Its like the message telling you that a picture is missing is a picture itself. So there's really not a good way to find it. Grrrr.

Thanks for the idea,

Dan

Share this post


Link to post
Share on other sites

I don't know the answer for Windows. But what I've done on a Mac is to use AppleScript (I imagine you could easily use a do shell script also) to just see if the file exists. You've got the supposed file path (from the info).

So on Windows it would be a command line of some type? I guess the trouble is that you don't get anything back. But if you used a command that returned an error if the file existed? or didn't? Anyone?

Share this post


Link to post
Share on other sites

Hey Fenton,

Long time no talk. The new job's keeping me hopping, so I'm around here less.

Thanks for that idea. I think that's the way to go. I'll write a batch file that looks for that file name. If it isn't there, then the record gets erased. It'll take some monkeying around, but that will work.

Thanks. I'll post my results.

Dan

Share this post


Link to post
Share on other sites

This is a challenge to do within FileMaker. There is no "Exists" function for external files, and IsValid does not work on external files. LastError doesn't return anything. Perhaps FMI should be asked to rectify this problem.

Share this post


Link to post
Share on other sites

I tried the following:

container =

Case (EvaluationError("imagewin:/" & Calctest2::file_name_for_container) = 0 ; "imagewin:/" & Calctest2::file_name_for_container )

So if EvaluationError <> 0, then container result should be null. But it isn't; the error message "The file cannot be found..." still appears in the container field. And if I change this to

container =

Case (EvaluationError("imagewin:/" & Calctest2::file_name_for_container) = 0 ; Evaluate ("imagewin:/" & Calctest2::file_name_for_container ))

I get nothing, even with valid filenames. This is very vexing.

Share this post


Link to post
Share on other sites

Depending upon how you delete the container contents, a work around is to alter another field when a picture is inserted or deleted. This still leaves the problem of these two field becoming unsynchronized (i.e. the actual file is deleted). We may be back to managing all this with Troi file, which is a good solution (with dependence upon a plugin).

-bd

Share this post


Link to post
Share on other sites

Here's the work around I use without any external add on's:

In one table 5 fields:

Filename

Photo

Thumbnail

Path

Missing Flag (calc) If ( IsValid ( PhotoPaths::Path ) ; 1 ; 0 )

Another table 1 field:

Path

Relate tables path to path

Import folder script does the following:

Import main photo folder

Go to path table

Delete all records

Import same folder only path

You can now flag missing phots by interogating the missing flag in the photo database.

Rod

Share this post


Link to post
Share on other sites

Hey Rod,

That's a good idea. The only downside is the length of time the import takes. Doing it twice takes twice as long, of course.

On that note, I built on Fenton's idea to import path names for non-picture files, no plug-in required. The same idea could be applied to picture files just as easily. This is a windows solution, but it could be adapted to applescript by someone with some imagination.

I wrote a 1-line batch file:

tree q: /f /a > tree.txt

I execute this batch file with a send message script step. This executes the tree command, which produces something like a graphical display of a directory structure. The /f switch tells it to include sub directories, and /a tells it to use ascii characters. The > tree.txt send the output to a text file rather than the screen.

Then I import tree.txt, and parse out the paths and file names. Tada! I've just imported file references for non-picture types.

While FM already lets you do it for picture types, this method is super fast, unlike the native FM picture importing. But using this method you couldn't see the picture in a container field or get a thumbnail.

Thanks for all of these ideas guys. I can see the light...

Dan

Share this post


Link to post
Share on other sites

Dan

As we do a lot of picture editing, updating and deleting, and drawing updates (these are PDF's), we found it best to do a daily batch update of these tables. This takes place in the middle of the night automatically along with our other daily MRP type updates. So time is not really an issue for us.

But on to my question for you. As we do almost all our photo editing via Mac platform, we use Graphic Converter as it is very fast, flexible and easy to use. Most of our manipulation is pretty basic, cropping, perhaps converting formats, adding a copyright logo etc. I have a new location that is already all set up with PC's, and am looking for a good simple cheap flexible photo editing application for PC to use there. Appreciate any recommendations.

Rod

Share this post


Link to post
Share on other sites

Hey Rod,

I use PhotoShop. Good and flexible? Yes. Simple? Not bad. Cheap? Not really. How many licenses do you need? If just a few, I'd spring for photoshop. The good news is that the new version of PS is out, so older versions (which will be more than enough for what you need) can be gotten pretty cheaply at this point. I Froogled it and found if for $370 for version 7 and $260 for version 6. (THese are for OEM versions.)

It also looks like google makes their own freeware photo editor called Picasa. You can find that here

http://www.picasa.com/content/download.php?

This looks pretty cool. I might try it myself.

Good luck,

Dan

Share this post


Link to post
Share on other sites

Thanks. I just tried Picasa myself. Looks pretty good for easy stuff like cropping, thumbnails, etc.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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