Calculation on container

Is there a way to know if a container field has changed data? I mean,
can I get a checksum or data dimension in byte or data type (image,
sound, etc...) and then for image the size in pixel...
borgobello-NO [ Do, 12 Juli 2007 18:03 ] [ ID #1766597 ]

Re: Calculation on container

In article <1i15ghy.1jsy6iw2domk4N%borgobello-NO [at] SPAM-adriacom.it>,
borgobello-NO [at] SPAM-adriacom.it (Aladino) wrote:

> Is there a way to know if a container field has changed data? I mean,
> can I get a checksum or data dimension in byte or data type (image,
> sound, etc...) and then for image the size in pixel...

It depends what you mean by "changed data" - how does it change?

You can test a Container field using the same functions as with any
other field type.

For example, you can test whether or not a Container field is empty by
using either:

If [ContainerField = ""]
Message ["ContainerFiled is empty"]
End If

or:
If [IsEmpty(ContainerField)]
Message ["ContainerFiled is empty"]
End If


You can test whether one Container field has the same data as another
Container field (or Global container field) by using:

If [ConterField_A = ContainerField_B]
Message ["ContainerFiled_A and ContainerField_B
have the same data."]
End If


If the Container field is linked to it's data rather than storing it,
then you should be able to use the directory path to the file to grab
the filename extension and work out what type of data it is.
ie.
If [Right(filepath, 3) = "jpg"]
Message ["ContainerFiled holds an image"]
End If

I'm not sure how you get that file path though.


You don't say what version of FileMaker, but as far as I know there is
no ability in any version to generate checksums from Container field
data, although there may be an extra plug-in that adds such an ability.


Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Helpful Harry [ Do, 12 Juli 2007 22:48 ] [ ID #1766610 ]

Re: Calculation on container

Aladino wrote:
> Is there a way to know if a container field has changed data? I mean,
> can I get a checksum or data dimension in byte or data type (image,
> sound, etc...) and then for image the size in pixel...


You could probably use DataLog (from NightWing ) and a calc to flag for
modificationdate/time changes. That would flag the same data been put in
again asa change, i.e. that there had been a 'change' event.


regards

Chris
Chris Brown [ Fr, 13 Juli 2007 02:17 ] [ ID #1767646 ]

Re: Calculation on container

Easy, and you don't need an external.

Just set up a text field with an auto-enter calculation:

MyContainerField & Get (CurrentTimeStamp)

Deselect "Do not replace existing value..."

The calc will change value only when the container field is modified.

If for some reason you need to know the size of the image (in pixels) then
you can store it as a reference; the dimensions are stored as the first line
of data returned by

ContainerData (calculation, text result) =
MyContainerField

e.g.:

size:320,240
image:myimage.jpg
imagewin:/D:/Desktop/myimage.jpg




"Chris Brown" <cbrown [at] medicine.adelaide.edu.au> wrote in message
news:f76gbb$e98$1 [at] aioe.org...
> Aladino wrote:
>> Is there a way to know if a container field has changed data? I mean,
>> can I get a checksum or data dimension in byte or data type (image,
>> sound, etc...) and then for image the size in pixel...
>
>
> You could probably use DataLog (from NightWing ) and a calc to flag for
> modificationdate/time changes. That would flag the same data been put in
> again asa change, i.e. that there had been a 'change' event.
>
>
> regards
>
> Chris
Bill Marriott [ Sa, 14 Juli 2007 16:22 ] [ ID #1768477 ]

Re: Calculation on container

Bill Marriott wrote:
> Easy, and you don't need an external.
>
> Just set up a text field with an auto-enter calculation:
>
> MyContainerField & Get (CurrentTimeStamp)
>
> Deselect "Do not replace existing value..."
>
> The calc will change value only when the container field is modified.
>
> If for some reason you need to know the size of the image (in pixels) then
> you can store it as a reference; the dimensions are stored as the first line
> of data returned by
>
> ContainerData (calculation, text result) =
> MyContainerField
>
> e.g.:
>
> size:320,240
> image:myimage.jpg
> imagewin:/D:/Desktop/myimage.jpg
>
>
>
>
> "Chris Brown" <cbrown [at] medicine.adelaide.edu.au> wrote in message
> news:f76gbb$e98$1 [at] aioe.org...
>> Aladino wrote:
>>> Is there a way to know if a container field has changed data? I mean,
>>> can I get a checksum or data dimension in byte or data type (image,
>>> sound, etc...) and then for image the size in pixel...
>>
>> You could probably use DataLog (from NightWing ) and a calc to flag for
>> modificationdate/time changes. That would flag the same data been put in
>> again asa change, i.e. that there had been a 'change' event.
>>
>>
>> regards
>>
>> Chris
>
>


Hi Bill,

that's a handy way to grab the file name. (I only parse the filename
when I import...)

The text field records the change, something is needed to compare to,
i.e to track the changes, the DataLog is handy; or a variation field...



The second part doesn't work for me:
calc field, text result, = container
I just get teh file name

<<
If for some reason you need to know the size of the image (in pixels) then
you can store it as a reference; the dimensions are stored as the first
line
of data returned by

ContainerData (calculation, text result) =
MyContainerField
>>


regards

Chris
Chris Brown [ So, 15 Juli 2007 02:19 ] [ ID #1769197 ]

Re: Calculation on container

In article <f7bp7d$m8m$1 [at] aioe.org> Chris
Brown<cbrown [at] medicine.adelaide.edu.au> wrote:

> If for some reason you need to know the size of the image (in
> pixels) then you can store it as a reference; the dimensions are
> stored as the first line of data returned by
>
> ContainerData (calculation, text result) =
> MyContainerField

I do want the size of the image.

I have tried everyhing I can think of, and do not get what you
describe.
Imported a folder of images as reference. Calculation returned as text
in all cases is "image:/Path/to/Folder/FileName.JPG"
Same if not as reference.

Matt
Matt Wills [ So, 15 Juli 2007 12:25 ] [ ID #1769198 ]

Re: Calculation on container

> The text field records the change, something is needed to compare to, i.e
> to track the changes, the DataLog is handy; or a variation field...

There are a variety of ways to track the changes made (i.e., compare to a
previous state) that do not require a plugin. I'm not saying anything
against DataLog but if it's only the one field you care about then why go to
the expense and added complexity of an external?

> The second part doesn't work for me:
> calc field, text result, = container
> I just get teh file name

You must add "by reference only" in order to get the image size and file
path information. If the file is not an image, you will not get the pixel
dimensions. If the field is not formatted to display multiple lines, you
will not see the file path.
Bill Marriott [ So, 15 Juli 2007 15:08 ] [ ID #1769199 ]

Re: Calculation on container

Unfortunately, FileMaker operates slightly differently when you import a
FOLDER of images, versus a single image. It does not record the pixel
dimensions in the container field when importing a folder.

It's impossible to get a file path in the container field if you are not
importing as reference (folder or single). FileMaker simply doesn't store
that there when is has possession of the actual file. However, you can put
the file path into a separate field. Perhaps you had it mapped accidentally.

If you have a folder of images and need to obtain the pixel size of each,
you can do one import of the folder to obtain the path to each image (but
don't import the pictures) then cycle through the imported records with a
script which does the one-by-one import by reference of each image as
specified by the path.

> I do want the size of the image.
>
> I have tried everyhing I can think of, and do not get what you
> describe.
> Imported a folder of images as reference. Calculation returned as text
> in all cases is "image:/Path/to/Folder/FileName.JPG"
> Same if not as reference.
Bill Marriott [ So, 15 Juli 2007 15:18 ] [ ID #1769200 ]

Re: Calculation on container

I'm surely missing something.

Whether manually or using a script, the only image option available is
in importing a full folder.
Importing a single file, there's no image option available, and all I
get is the text representation of the file (such as you would see if
you opened a JPG in a text editor.
Nowhere do I see recognizable representation of the image size.

I also tried Insert Image, using the same script variable to specify
the file. The image is stored, but that's all.
Matt

In article <9ridnbLaZs-RggfbnZ2dnUVZ_gWdnZ2d [at] comcast.com>
"BillMarriott" <wjm [at] wjm.org> wrote:

> Unfortunately, FileMaker operates slightly differently when you
> import a FOLDER of images, versus a single image. It does not record
> the pixel dimensions in the container field when importing a folder.
>
> It's impossible to get a file path in the container field if you are
> not importing as reference (folder or single). FileMaker simply
> doesn't store that there when is has possession of the actual file.
> However, you can put the file path into a separate field. Perhaps you
> had it mapped accidentally.
> If you have a folder of images and need to obtain the pixel size of
> each, you can do one import of the folder to obtain the path to each
> image (but don't import the pictures) then cycle through the imported
> records with a script which does the one-by-one import by reference
> of each image as specified by the path.
>
>> I do want the size of the image.
>>
>> I have tried everyhing I can think of, and do not get what you
>> describe.
>> Imported a folder of images as reference. Calculation returned as
>> text in all cases is "image:/Path/to/Folder/FileName.JPG"
>> Same if not as reference.

>
>
Matt Wills [ So, 15 Juli 2007 17:04 ] [ ID #1769201 ]

Re: Calculation on container

Matt WIlls wrote:
> I'm surely missing something.
>
> Whether manually or using a script, the only image option available is
> in importing a full folder.
> Importing a single file, there's no image option available, and all I
> get is the text representation of the file (such as you would see if
> you opened a JPG in a text editor.
> Nowhere do I see recognizable representation of the image size.
>
> I also tried Insert Image, using the same script variable to specify
> the file. The image is stored, but that's all.
> Matt
>
> In article <9ridnbLaZs-RggfbnZ2dnUVZ_gWdnZ2d [at] comcast.com>
> "BillMarriott" <wjm [at] wjm.org> wrote:
>
>> Unfortunately, FileMaker operates slightly differently when you
>> import a FOLDER of images, versus a single image. It does not record
>> the pixel dimensions in the container field when importing a folder.
>>
>> It's impossible to get a file path in the container field if you are
>> not importing as reference (folder or single). FileMaker simply
>> doesn't store that there when is has possession of the actual file.
>> However, you can put the file path into a separate field. Perhaps you
>> had it mapped accidentally.
>> If you have a folder of images and need to obtain the pixel size of
>> each, you can do one import of the folder to obtain the path to each
>> image (but don't import the pictures) then cycle through the imported
>> records with a script which does the one-by-one import by reference
>> of each image as specified by the path.
>>
>>> I do want the size of the image.
>>>
>>> I have tried everyhing I can think of, and do not get what you
>>> describe.
>>> Imported a folder of images as reference. Calculation returned as
>>> text in all cases is "image:/Path/to/Folder/FileName.JPG"
>>> Same if not as reference.
>
>>
>>
>
>

I get the same, having tried the same variations


Chris
Chris Brown [ Mo, 16 Juli 2007 06:10 ] [ ID #1769876 ]

Re: Calculation on container

"You could probably use DataLog (from NightWing )"
that should be SuperLog




Bill Marriott wrote:
> Easy, and you don't need an external.
>
>>>


SuperLog is just a custom function.


Chris
Chris Brown [ Mo, 16 Juli 2007 06:14 ] [ ID #1769877 ]

Re: Calculation on container

Given the fields:

thefilepath (text)
yourcontainerfield (container)
containercalc (calculation, text result) = yourcontainerfield

1. File--> Import Records --> Folder...
2. Specify a folder with images
3. Select "Import only a reference..."
4. Click Continue...

5. Map File Path to the field "thefilepath" -- Do not map anything else.

6. After Import, run the following script:

Set Error Capture [On]
Go to Record/Request/Page [First]
Loop
Set Variable [$x;
Value:Substitute(yourtable::thefilepath;"file://";"image:/") ]
Go to Field [yourtable::yourcontainerfield]
Insert Picture [Reference; "$x"]
Go to Record/Request/Page [Next; Exit after last]
End Loop

At the conclusion of the script, containercalc *will* contain pixel
resolution for the images.
Bill Marriott [ Mo, 16 Juli 2007 09:12 ] [ ID #1769878 ]

Re: Calculation on container

In article <v8ednaGtycGZhgbbnZ2dnUVZ_iydnZ2d [at] comcast.com>
"BillMarriott" <wjm [at] wjm.org> wrote:

> Given the fields:
>
> thefilepath (text)
> yourcontainerfield (container)
> containercalc (calculation, text result) = yourcontainerfield
>
> 1. File--> Import Records --> Folder...
> 2. Specify a folder with images
> 3. Select "Import only a reference..."
> 4. Click Continue...
>
> 5. Map File Path to the field "thefilepath" -- Do not map anything
> else.
> 6. After Import, run the following script:
>
> Set Error Capture [On]
> Go to Record/Request/Page [First]
> Loop
> Set Variable [$x;
> Value:Substitute(yourtable::thefilepath;"file://";"image:/") ]
> Go to Field [yourtable::yourcontainerfield]
> Insert Picture [Reference; "$x"]
> Go to Record/Request/Page [Next; Exit after last]
> End Loop
>
> At the conclusion of the script, containercalc *will* contain pixel
> resolution for the images.
>

Not here, it doesn't.

Steps as described followed precisely. I have the file name and
nothing else.
Perhaps I should have asked this before: is this possibly
platform-specific? I am doing this on OSX 10.4.9. I just got home from
my 12-hour night shift. After a bit of a nap, I will try it on XP.
Matt
Matt Wills [ Mo, 16 Juli 2007 15:44 ] [ ID #1769881 ]

Re: Calculation on container

I verified the procedure both on Windows XP and Mac OS X using FileMaker 8.5
before posting.


> Not here, it doesn't.
>
> Steps as described followed precisely. I have the file name and
> nothing else.
> Perhaps I should have asked this before: is this possibly
> platform-specific? I am doing this on OSX 10.4.9. I just got home from
> my 12-hour night shift. After a bit of a nap, I will try it on XP.
> Matt
>
>
>
Bill Marriott [ Mo, 16 Juli 2007 15:59 ] [ ID #1769882 ]

Re: Calculation on container

Matt WIlls wrote:
> In article <v8ednaGtycGZhgbbnZ2dnUVZ_iydnZ2d [at] comcast.com>
> "BillMarriott" <wjm [at] wjm.org> wrote:
>
>> At the conclusion of the script, containercalc *will* contain pixel
>> resolution for the images.
>>
> Not here, it doesn't.


How are you getting the resolution, Bill? I think the length() function
will give you image size.

Or are you using GetLayoutObjectAttribute(objectName; "content"/"source")?


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

FileMaker 8 Certified Developer
Member, FileMaker Business Alliance
Howard Schlossberg [ Mo, 16 Juli 2007 18:36 ] [ ID #1769884 ]

Re: Calculation on container

Hi Howard,

> How are you getting the resolution, Bill? I think the length() function
> will give you image size.
>
> Or are you using GetLayoutObjectAttribute(objectName; "content"/"source")?

I'm not doing anything special beyond the script I posted...

Perhaps my computer is just a little bit smarter? Perhaps I'm going to have
to post a video or something to show I'm not using any special tricks.
Bill Marriott [ Mo, 16 Juli 2007 19:45 ] [ ID #1769886 ]

Re: Calculation on container

In article <ZZSdna6clcjWMgbbnZ2dnUVZ_gKdnZ2d [at] comcast.com>
"BillMarriott" <wjm [at] wjm.org> wrote:

> Hi Howard,
>
>> How are you getting the resolution, Bill? I think the length()
>> function will give you image size.
>>
>> Or are you using GetLayoutObjectAttribute(objectName;
>> "content"/"source")?

> I'm not doing anything special beyond the script I posted...
>
> Perhaps my computer is just a little bit smarter? Perhaps I'm going
> to have to post a video or something to show I'm not using any
> special tricks.
>

We're both using the same system, the same application (FM 8.5), and
the same procedure, but getting different results.
Your guess is as good as mine.

Matt
Matt Wills [ Mo, 16 Juli 2007 20:25 ] [ ID #1769888 ]

Re: Calculation on container

Helpful Harry <helpful_harry [at] nom.de.plume.com> wrote:

> You don't say what version of FileMaker, but as far as I know there is
> no ability in any version to generate checksums from Container field
> data
I'm using filemaker 8.5, my need is to create a registration number
starting from the data contained in the header field that applies on all
forms that my solution can print. Before now I used a Text field for the
header, but some clients found the text header to less elastic
borgobello-NO [ Mo, 16 Juli 2007 21:30 ] [ ID #1769891 ]

Re: Calculation on container

Bill Marriott wrote:
> I verified the procedure both on Windows XP and Mac OS X using FileMaker 8.5
> before posting.
>
>
>> Not here, it doesn't.
>>
>> Steps as described followed precisely. I have the file name and
>> nothing else.
>> Perhaps I should have asked this before: is this possibly
>> platform-specific? I am doing this on OSX 10.4.9. I just got home from
>> my 12-hour night shift. After a bit of a nap, I will try it on XP.
>> Matt
>>
>>
>>
>
>


ah, 8.5
8.0Adv here, OSX.4.10


Chris
Chris Brown [ Di, 17 Juli 2007 00:03 ] [ ID #1769892 ]
Datenbanken » comp.databases.filemaker » Calculation on container

Vorheriges Thema: Multiple relations ship problem.
Nächstes Thema: Simple question: Printing a layout structure with field names?