5 Replies Latest reply on Jul 27, 2009 4:37 AM by comment_1

    Calc Field that shows the size of my container image

    fotowork

      Title

      Calc Field that shows the size of my container image

      Post

      I am trying to slim down my photo database and I would like to create a calculator field that shows my image size within containers.   Can I use a "get"  function?  I can't get this to work.

        • 1. Re: Calc Field that shows the size of my container image
          raybaudi
            

          Hi fotowork

           

          from Help On Line :

           

          Length function

          Format

          Length(field)
          
          

          Parameter

          field - any text, number, date, time, timestamp, or container field, or any text expression or numeric expression

           Data type returned

          number

          Description

          Returns the number of characters in field, including all spaces, numbers, and special characters. For a container field, Length returns the total stored size of objects in bytes.

          • 2. Re: Calc Field that shows the size of my container image
            MstrPBK
              

            odd pause ... is there a direct reletionship between the image size (bytes) and the number of pixels within a given byte?

             

            MstrPBK

            St. Paul, MN USA

             

             

            ADDITION: If I am reading this right there are 24 bytes to one pixel so if this is correct then the pixel count ought to be ... Byte count/24 ... does that sound right to others?

            • 3. Re: Calc Field that shows the size of my container image
              comment_1
                

              MstrPBK wrote:
              is there a way to get the pixel height and width of said image in the container feild?

              It depends: if the image was inserted into the container field as reference only, then the dimensions in pixels will be available as the first value of =

              GetAsText ( ContainerField )

               

               


              MstrPBK wrote:
              If I am reading this right there are 24 bytes to one pixel so if this is correct then the pixel count ought to be ... Byte count/24 ... does that sound right to others?

               

              That would be roughly correct for uncompressed bitmap images (roughly, because of the metadata included in the file). With compressed formats (e.g. jpg, gif, png) there is no way to tell the image dimensions from the file size.

              • 4. Re: Calc Field that shows the size of my container image
                MstrPBK
                  

                The image is a cropped image taken from a jpg image which is taken into appleworks paint document, cropped, and then pasted into the FileMaker Pro container feild.  the  Appleworks 'white board' is simply used as cropping tool

                 

                [pause] Should I be converting these to Bitmap?

                 

                Addition: all I get when I use GetAsText ( ContainerField ) is a question mark (?)

                • 5. Re: Calc Field that shows the size of my container image
                  comment_1
                    

                  MstrPBK wrote:

                  all I get when I use GetAsText ( ContainerField ) is a question mark (?)


                  As I said, this only works for images that have been inserted (not pasted) into the container field, as reference only.

                   

                  Pasted images have no text component, and embedded image files will display their original filename only.