does image file exist

  • Follow


Hi all,

I have added a calculated container field to the database. That is, a
container with a dynamically created reference to an image. If the
image exists then it displays in the containter field. Fantastic.

The calculation looks this this...

"imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
200/01.jpg"

It would be great if I knew that the image had been found as was
currently being displayed. Is there a way I can do this? If the image
exists then I would want to use that fact in another calculation,
something like...

if imagesexists in container then
   x=1
else
   x=0
end if

any tips? Many thanks
C10B
0
Reply Citizen10Bears (73) 7/28/2008 9:16:25 AM

Can't be done without very extensive scripting. Where you basicaly have to 
import the refenced image. Then if the import failed you know the image file 
doesn't exist. But you have to relaunch the script everytime you want to 
make sure the image still is there. It would be much easier to reuse the 
calculated field, make it thumbnail size then put this on your layout for 
visual reference.

Keep well, ursus

"C10B" <Citizen10Bears@gmail.com> schreef in bericht 
news:e333aa92-e81c-40b2-82e4-9d1a7c8e3158@79g2000hsk.googlegroups.com...
> Hi all,
>
> I have added a calculated container field to the database. That is, a
> container with a dynamically created reference to an image. If the
> image exists then it displays in the containter field. Fantastic.
>
> The calculation looks this this...
>
> "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
> 200/01.jpg"
>
> It would be great if I knew that the image had been found as was
> currently being displayed. Is there a way I can do this? If the image
> exists then I would want to use that fact in another calculation,
> something like...
>
> if imagesexists in container then
>   x=1
> else
>   x=0
> end if
>
> any tips? Many thanks
> C10B 


0
Reply ursus.kirk733 (131) 7/28/2008 1:49:31 PM


I haven't tested this, but I would expect something like this to work:

Let( img = "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & 
"/200/01.jpg";

isempty(x)
)


C10B wrote:
> Hi all,
> 
> I have added a calculated container field to the database. That is, a
> container with a dynamically created reference to an image. If the
> image exists then it displays in the containter field. Fantastic.
> 
> The calculation looks this this...
> 
> "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
> 200/01.jpg"
> 
> It would be great if I knew that the image had been found as was
> currently being displayed. Is there a way I can do this? If the image
> exists then I would want to use that fact in another calculation,
> something like...
> 
> if imagesexists in container then
>    x=1
> else
>    x=0
> end if
> 
> any tips? Many thanks
> C10B

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc.    Los Angeles

FileMaker 8 Certified Developer
Member, FileMaker Business Alliance
0
Reply howard4272 (336) 7/28/2008 3:52:58 PM

"Howard Schlossberg" <howard@nospam.fmprosolutions.com> schreef in bericht 
news:vXljk.7334$Zf.172@fe117.usenetserver.com...
>I haven't tested this, but I would expect something like this to work:
>
> Let( img = "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & 
> "/200/01.jpg";
>
> isempty(x)
> )
>

Howard, it wouldn't work. Filemaker evaluates this as plain text. And the 
result would be always untrue, because the calc would always contain some 
text. It only shows up as image in a calculated container, but if you take 
the same calc and change the result to text it would only contain the text 
result of the calculation. I've been looking for ways to do this for some 
time now, but haven't found one.

(and your calc is faulty, if there would be any chance it should read 
isempty(img) )

Keep well, Ursus 


0
Reply ursus.kirk733 (131) 7/29/2008 1:02:35 PM

Yeah, that was stupid on my part.  What I should have suggested was to 
set a container field (through script or through unstored calc field) to 
"imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/200/01.jpg" 
and then test the container field for isempty().


Ursus wrote:
> "Howard Schlossberg" <howard@nospam.fmprosolutions.com> schreef in bericht 
> news:vXljk.7334$Zf.172@fe117.usenetserver.com...
>> I haven't tested this, but I would expect something like this to work:
>>
>> Let( img = "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & 
>> "/200/01.jpg";
>>
>> isempty(x)
>> )
>>
> 
> Howard, it wouldn't work. Filemaker evaluates this as plain text. And the 
> result would be always untrue, because the calc would always contain some 
> text. It only shows up as image in a calculated container, but if you take 
> the same calc and change the result to text it would only contain the text 
> result of the calculation. I've been looking for ways to do this for some 
> time now, but haven't found one.
> 
> (and your calc is faulty, if there would be any chance it should read 
> isempty(img) )
> 
> Keep well, Ursus 
> 
> 

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg
FM Professional Solutions, Inc.    Los Angeles

FileMaker 8 Certified Developer
Member, FileMaker Business Alliance
0
Reply howard4272 (336) 7/29/2008 6:08:01 PM

On Mon, 28 Jul 2008 02:16:25 -0700 (PDT), C10B
<Citizen10Bears@gmail.com> wrote:

>Hi all,
>
>I have added a calculated container field to the database. That is, a
>container with a dynamically created reference to an image. If the
>image exists then it displays in the containter field. Fantastic.
>
>The calculation looks this this...
>
>"imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
>200/01.jpg"
>
>It would be great if I knew that the image had been found as was
>currently being displayed. Is there a way I can do this? If the image
>exists then I would want to use that fact in another calculation,
>something like...
>
>if imagesexists in container then
>   x=1
>else
>   x=0
>end if
>
>any tips? Many thanks
>C10B

It can be done.  It does have to be scripted, but it's not that
complicated.  What I do is use a separate, secondary .fp7 file to hold
images and image references.  The secondary file pulls the calculated
file/pathnames from the main file, then the main file pulls the images
from the secondary and displays them.  I use error capture determine
whether the image file exists or not, and a Case function to decide
what to do about it.  It works best if you insert the images directly
into the secondary .fp7 file, because then you have 2 conditions to
test for: does the file exist (using error capture), and is the file
in your db (using IsEmpty).

IMO you're always better off inserting images into your db instead of
using references.  It's just safer and more comprehensive doing it
that way.  Images can make your db file enormous and slow it down,
yes, but using a secondary file for image storage pretty much
eliminates those problems.  That trick is one the guys on this board
turned me on to.

hope this helps

-- 
FW

FileMaker Pro 8.5 Advanced on Windows XP Pro SP2
FileMaker Server 8.0 on Windows 2003 Server R2
0
Reply wolfsofast1 (205) 7/29/2008 6:45:36 PM

FastWolf, You basicaly explained what I hinted at in my first reply. I have 
tried it, but found it unreliable. The system works, but can you really be 
sure nothing has changed since the last time you have run the script. And 
with lots of images the logging of errors can become quite extensive. But 
yes it does work.

Keep well, Ursus


"FastWolf" <wolfsofast@NOSPAMcomcast.net> schreef in bericht 
news:c7ou84d6h06v8qlhsrsrm4899jmtoh19u4@4ax.com...
> On Mon, 28 Jul 2008 02:16:25 -0700 (PDT), C10B
> <Citizen10Bears@gmail.com> wrote:
>
>>Hi all,
>>
>>I have added a calculated container field to the database. That is, a
>>container with a dynamically created reference to an image. If the
>>image exists then it displays in the containter field. Fantastic.
>>
>>The calculation looks this this...
>>
>>"imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
>>200/01.jpg"
>>
>>It would be great if I knew that the image had been found as was
>>currently being displayed. Is there a way I can do this? If the image
>>exists then I would want to use that fact in another calculation,
>>something like...
>>
>>if imagesexists in container then
>>   x=1
>>else
>>   x=0
>>end if
>>
>>any tips? Many thanks
>>C10B
>
> It can be done.  It does have to be scripted, but it's not that
> complicated.  What I do is use a separate, secondary .fp7 file to hold
> images and image references.  The secondary file pulls the calculated
> file/pathnames from the main file, then the main file pulls the images
> from the secondary and displays them.  I use error capture determine
> whether the image file exists or not, and a Case function to decide
> what to do about it.  It works best if you insert the images directly
> into the secondary .fp7 file, because then you have 2 conditions to
> test for: does the file exist (using error capture), and is the file
> in your db (using IsEmpty).
>
> IMO you're always better off inserting images into your db instead of
> using references.  It's just safer and more comprehensive doing it
> that way.  Images can make your db file enormous and slow it down,
> yes, but using a secondary file for image storage pretty much
> eliminates those problems.  That trick is one the guys on this board
> turned me on to.
>
> hope this helps
>
> -- 
> FW
>
> FileMaker Pro 8.5 Advanced on Windows XP Pro SP2
> FileMaker Server 8.0 on Windows 2003 Server R2 


0
Reply ursus.kirk733 (131) 7/30/2008 7:08:26 AM

"Howard Schlossberg" <howard@nospam.fmprosolutions.com> schreef in bericht 
news:70Jjk.19033$gg.17786@fe105.usenetserver.com...
> Yeah, that was stupid on my part.  What I should have suggested was to set 
> a container field (through script or through unstored calc field) to 
> "imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/200/01.jpg" 
> and then test the container field for isempty().
>
>


Sorry Howard, but Filemaker still would evaluate the field as containing 
text and would never return an empty container. For the container to contain 
an image, the image would have to be imported, not referenced.

Keep well, Ursus 


0
Reply ursus.kirk733 (131) 7/30/2008 7:10:49 AM

On Wed, 30 Jul 2008 09:08:26 +0200, "Ursus" <ursus.kirk@orange.nl>
wrote:

>FastWolf, You basicaly explained what I hinted at in my first reply. I have 
>tried it, but found it unreliable. The system works, but can you really be 
>sure nothing has changed since the last time you have run the script.

No, you can't, not from within FMP, unless you always run the script
before viewing the record.

> And 
>with lots of images the logging of errors can become quite extensive.

You're right, and all it can do is tell you is a file exists (which
after all was the OP's question), but not how recent it is nor whether
it's newer or older than the one you have inserted.

>yes it does work.

It works best when the number of users is relatively small and the DBA
can maintain near-total control over the source folder[s] of images;
and/or when the images are not likely to be changed or updated.

-- 
FW


>"FastWolf" <wolfsofast@NOSPAMcomcast.net> schreef in bericht 
>news:c7ou84d6h06v8qlhsrsrm4899jmtoh19u4@4ax.com...
>> On Mon, 28 Jul 2008 02:16:25 -0700 (PDT), C10B
>> <Citizen10Bears@gmail.com> wrote:
>>
>>>Hi all,
>>>
>>>I have added a calculated container field to the database. That is, a
>>>container with a dynamically created reference to an image. If the
>>>image exists then it displays in the containter field. Fantastic.
>>>
>>>The calculation looks this this...
>>>
>>>"imagewin:/" & vehiclesfolder & "" & RegistrationNumber & "/
>>>200/01.jpg"
>>>
>>>It would be great if I knew that the image had been found as was
>>>currently being displayed. Is there a way I can do this? If the image
>>>exists then I would want to use that fact in another calculation,
>>>something like...
>>>
>>>if imagesexists in container then
>>>   x=1
>>>else
>>>   x=0
>>>end if
>>>
>>>any tips? Many thanks
>>>C10B
>>
>> It can be done.  It does have to be scripted, but it's not that
>> complicated.  What I do is use a separate, secondary .fp7 file to hold
>> images and image references.  The secondary file pulls the calculated
>> file/pathnames from the main file, then the main file pulls the images
>> from the secondary and displays them.  I use error capture determine
>> whether the image file exists or not, and a Case function to decide
>> what to do about it.  It works best if you insert the images directly
>> into the secondary .fp7 file, because then you have 2 conditions to
>> test for: does the file exist (using error capture), and is the file
>> in your db (using IsEmpty).
>>
>> IMO you're always better off inserting images into your db instead of
>> using references.  It's just safer and more comprehensive doing it
>> that way.  Images can make your db file enormous and slow it down,
>> yes, but using a secondary file for image storage pretty much
>> eliminates those problems.  That trick is one the guys on this board
>> turned me on to.
>>
>> hope this helps
>>
>> -- 
>> FW
>>
>> FileMaker Pro 8.5 Advanced on Windows XP Pro SP2
>> FileMaker Server 8.0 on Windows 2003 Server R2 
>

FileMaker Pro 8.5 Advanced on Windows XP Pro SP2
FileMaker Server 8.0 on Windows 2003 Server R2
0
Reply wolfsofast1 (205) 7/30/2008 11:47:58 PM

8 Replies
48 Views

(page loaded in 0.22 seconds)

Similiar Articles:













7/16/2012 6:57:34 PM


Reply: