IOkate Posted March 14, 2005 Author Posted March 14, 2005 Hi, I have searched the forums for how to do this, but I couldn't find the answer. Sorry, if it's been posted and I just missed it. I am making a simple document library, and I want to display the size of files imported into my container field (named 'Image'). I have tried GetAsText(Image), but all it returns is the file name. From other posts, I know that people are somehow getting file sizes using what looks to be the same method: http://www.fmforums.com/threads/showflat.php?Cat=0&Number=134712&an=0&page=3#134712 http://www.fmforums.com/threads/showflat.php?Cat=0&Number=133384&an=0&page=4#133384 The files themselves are imported, not just a path to the file. Can anyone tell me what I'm doing wrong? Thanks, Kate.
IOkate Posted March 14, 2005 Posted March 14, 2005 Hi, I have searched the forums for how to do this, but I couldn't find the answer. Sorry, if it's been posted and I just missed it. I am making a simple document library, and I want to display the size of files imported into my container field (named 'Image'). I have tried GetAsText(Image), but all it returns is the file name. From other posts, I know that people are somehow getting file sizes using what looks to be the same method: http://www.fmforums.com/threads/showflat.php?Cat=0&Number=134712&an=0&page=3#134712 http://www.fmforums.com/threads/showflat.php?Cat=0&Number=133384&an=0&page=4#133384 The files themselves are imported, not just a path to the file. Can anyone tell me what I'm doing wrong? Thanks, Kate.
IOkate Posted March 14, 2005 Author Posted March 14, 2005 Hi, I have searched the forums for how to do this, but I couldn't find the answer. Sorry, if it's been posted and I just missed it. I am making a simple document library, and I want to display the size of files imported into my container field (named 'Image'). I have tried GetAsText(Image), but all it returns is the file name. From other posts, I know that people are somehow getting file sizes using what looks to be the same method: http://www.fmforums.com/threads/showflat.php?Cat=0&Number=134712&an=0&page=3#134712 http://www.fmforums.com/threads/showflat.php?Cat=0&Number=133384&an=0&page=4#133384 The files themselves are imported, not just a path to the file. Can anyone tell me what I'm doing wrong? Thanks, Kate.
Walter B Posted March 14, 2005 Posted March 14, 2005 There are two other get functions that may help. Get(FileSize) and Get(ActiveSelectionSize). These may help
Walter B Posted March 14, 2005 Posted March 14, 2005 There are two other get functions that may help. Get(FileSize) and Get(ActiveSelectionSize). These may help
Walter B Posted March 14, 2005 Posted March 14, 2005 There are two other get functions that may help. Get(FileSize) and Get(ActiveSelectionSize). These may help
-Queue- Posted March 14, 2005 Posted March 14, 2005 Get(FileSize) returns the current database file's size and Get(ActiveSelectionSize) returns how many characters are selected (highlighted) in the current field. Neither, I'm afraid, will be of any use in this situation. GetAsText(container) works fine to return the dimensions for imported images on Windows. Maybe it's a Mac issue? Are you using 7.0v3?
-Queue- Posted March 14, 2005 Posted March 14, 2005 Get(FileSize) returns the current database file's size and Get(ActiveSelectionSize) returns how many characters are selected (highlighted) in the current field. Neither, I'm afraid, will be of any use in this situation. GetAsText(container) works fine to return the dimensions for imported images on Windows. Maybe it's a Mac issue? Are you using 7.0v3?
-Queue- Posted March 14, 2005 Posted March 14, 2005 Get(FileSize) returns the current database file's size and Get(ActiveSelectionSize) returns how many characters are selected (highlighted) in the current field. Neither, I'm afraid, will be of any use in this situation. GetAsText(container) works fine to return the dimensions for imported images on Windows. Maybe it's a Mac issue? Are you using 7.0v3?
IOkate Posted March 14, 2005 Author Posted March 14, 2005 Yes, it's 7.0v3. I just started using a Mac last week, so I have no idea how it would make a difference in this particular function. It's not imperative that I have the file size; it would just be a nice feature for my own purposes. Thanks. Kate.
IOkate Posted March 14, 2005 Author Posted March 14, 2005 Yes, it's 7.0v3. I just started using a Mac last week, so I have no idea how it would make a difference in this particular function. It's not imperative that I have the file size; it would just be a nice feature for my own purposes. Thanks. Kate.
IOkate Posted March 14, 2005 Author Posted March 14, 2005 Yes, it's 7.0v3. I just started using a Mac last week, so I have no idea how it would make a difference in this particular function. It's not imperative that I have the file size; it would just be a nice feature for my own purposes. Thanks. Kate.
Fenton Posted March 15, 2005 Posted March 15, 2005 I said: "I don't think you can get the size of an object embedded in a container field." I am sometimes an idiot. As someone pointed out later (and which I have in one of files but forgot) you can use Length (container field). This only works with embedded files (or images), not with referenced files (which appears later in this thread).
Fenton Posted March 15, 2005 Posted March 15, 2005 I said: "I don't think you can get the size of an object embedded in a container field." I am sometimes an idiot. As someone pointed out later (and which I have in one of files but forgot) you can use Length (container field). This only works with embedded files (or images), not with referenced files (which appears later in this thread).
Fenton Posted March 15, 2005 Posted March 15, 2005 I said: "I don't think you can get the size of an object embedded in a container field." I am sometimes an idiot. As someone pointed out later (and which I have in one of files but forgot) you can use Length (container field). This only works with embedded files (or images), not with referenced files (which appears later in this thread).
stanley Posted March 15, 2005 Posted March 15, 2005 Strangely, on the Mac, GetAsText() gets the file size for a referenced image, but not for one stored within the database. I would have thought the opposite would have been true. With a stored image, all you get is the image's file name which, given that it is stored within the db file, is no longer really a valid attribute of the image... I have to wonder if this is a planned feature, or just the way it worked out. It would be quite a handy function to be able to find the memory size of a stored image, as a large image can have a devastating effect on a networked solution. Pity that we have to resort to a plug-in for that function. -Stanley
stanley Posted March 15, 2005 Posted March 15, 2005 Strangely, on the Mac, GetAsText() gets the file size for a referenced image, but not for one stored within the database. I would have thought the opposite would have been true. With a stored image, all you get is the image's file name which, given that it is stored within the db file, is no longer really a valid attribute of the image... I have to wonder if this is a planned feature, or just the way it worked out. It would be quite a handy function to be able to find the memory size of a stored image, as a large image can have a devastating effect on a networked solution. Pity that we have to resort to a plug-in for that function. -Stanley
stanley Posted March 15, 2005 Posted March 15, 2005 Strangely, on the Mac, GetAsText() gets the file size for a referenced image, but not for one stored within the database. I would have thought the opposite would have been true. With a stored image, all you get is the image's file name which, given that it is stored within the db file, is no longer really a valid attribute of the image... I have to wonder if this is a planned feature, or just the way it worked out. It would be quite a handy function to be able to find the memory size of a stored image, as a large image can have a devastating effect on a networked solution. Pity that we have to resort to a plug-in for that function. -Stanley
IOkate Posted March 15, 2005 Author Posted March 15, 2005 It looks like I'm going to not store the files in the database, then, and just upload them to a related folder. Having them stored in the database might be bad design, anyway - it's just my own document library now, but other people will probably end up accessing it and the files are rather large (hi-res PDF). In your experience(s), *is* it A Bad Thing to store files in the database?
IOkate Posted March 15, 2005 Author Posted March 15, 2005 It looks like I'm going to not store the files in the database, then, and just upload them to a related folder. Having them stored in the database might be bad design, anyway - it's just my own document library now, but other people will probably end up accessing it and the files are rather large (hi-res PDF). In your experience(s), *is* it A Bad Thing to store files in the database?
IOkate Posted March 15, 2005 Author Posted March 15, 2005 It looks like I'm going to not store the files in the database, then, and just upload them to a related folder. Having them stored in the database might be bad design, anyway - it's just my own document library now, but other people will probably end up accessing it and the files are rather large (hi-res PDF). In your experience(s), *is* it A Bad Thing to store files in the database?
stanley Posted March 17, 2005 Posted March 17, 2005 The problem you run into with images stored in the database is that you can suffer real slowdowns on a networked solution; this should be less of a problem in 7 than it was in earlier versions, but it can still slow the system to a crawl, especially if there is a list layout with the images, and a user is able to browse quickly through them... -Stanley
stanley Posted March 17, 2005 Posted March 17, 2005 The problem you run into with images stored in the database is that you can suffer real slowdowns on a networked solution; this should be less of a problem in 7 than it was in earlier versions, but it can still slow the system to a crawl, especially if there is a list layout with the images, and a user is able to browse quickly through them... -Stanley
stanley Posted March 17, 2005 Posted March 17, 2005 The problem you run into with images stored in the database is that you can suffer real slowdowns on a networked solution; this should be less of a problem in 7 than it was in earlier versions, but it can still slow the system to a crawl, especially if there is a list layout with the images, and a user is able to browse quickly through them... -Stanley
carlschneider Posted May 2, 2005 Posted May 2, 2005 What am I doing wrong? I'm trying to get the dimensions of images stored in a container field, as discussed here. My images are referenced, not stored directly. I am using the GetAsText (container) function, but it is only giving me the path to the images (image:/G4 DP/Applications/FileMaker Pro 7/Web/WEBSITE-THUMBNAILS/1001T.jpg), and does not give me the dimensions.
Matthew F Posted May 3, 2005 Posted May 3, 2005 This is how it works for me... If my image is local (on the same computer) the GetAsText () function returns the file size on one line followed by the Path(s) on the following lines. Make sure your field is big enough to display several lines of text. If my image is on a remote machine the photo size is not calculated.
carlschneider Posted May 3, 2005 Posted May 3, 2005 This works for me when I have manually imported the image (as a referenced file). However, my container fields with the images are actually calculation fields with the result being a container. The GetAsText () function is only giving me the path to the image (which is the path in my calculation). Is there a way to get the image dimensions in this situation? Or maybe there is another way to do what I'm trying to accomplish. What I'm trying to do is have my database automatically determine if an image is a vertical, horizontal, (portrait or landscape), or square. Is there another way of doing this?
Fenton Posted May 4, 2005 Posted May 4, 2005 If you have the path (converted to a Mac AppleScript path, with ":") and you're on Mac OS X, could you use ImageEvents to get the dimensions? Example: set theImage to choose file -- returns an alias path; you'd need the mounted volume name at the first tell application "Image Events" launch set thisImage to open theImage try set theSize to dimensions of thisImage set theHeight to (item 2 of theSize) set theWidth to (item 1 of theSize) end try end tell
carlschneider Posted May 4, 2005 Posted May 4, 2005 Thanks for your help. Here is my exact calculation path (IMAGE NUMBER is a field in each record): "image:/G4 DP/Applications/FileMaker Pro 7/Web/WEBSITE-DISPLAY_IMAGES/" & IMAGE NUMBER & ".jpg" I don't know what ImageEvents is or how it works (and I did a search for it and couldn't find anything). Can you give me some more info on this approach? Thanks.
Fenton Posted May 4, 2005 Posted May 4, 2005 Image Events (not ImageEvents, my typo) is a built-in faceless application in OS X, at least in Panther and above. It will be more well known in Tiger. It can handle simple image processing and conversion. To see what it can do, open it with Script Editor, or drop it on Script Editor (or put it in Script Editor's Library drawer, most convenient). This is where it is: Macintosh HD:System:Library:CoreServices:Image Events.app All you need to do is get your path into standard AppleScript Mac file path syntax, by using a FileMaker text calculation. Like: _cImagePath = "G4 DP:Applications:FileMaker Pro 7:Web:WEBSITE-DISPLAY_IMAGES:" & IMAGE NUMBER & ".jpg" Calc result. "G4 DP:Applications:FileMaker Pro 7:Web:WEBSITE-DISPLAY_IMAGES:12142.jpg" Pass that to AppleScript. Add a "alias " or "file " prefix for a file reference. Then ImageEvents can get the dimensions. Ex. (_cImagePath is on the current layout): --tell app "FileMaker Pro" -- not needed in a Perform AppleScript step, only in Script Editor set theImage to cell "_cImagePath" of current record tell application "Image Events" launch set thisImage to open file theImage try set theSize to dimensions of thisImage set theHeight to (item 2 of theSize) set theWidth to (item 1 of theSize) end try close thisImage end tell set cell "ImageWidth" of current record to theWidth set cell "ImageHeight" of current record to theHeight -- end tell -- not needed in a Perform AppleScript step, only in Script Editor
carlschneider Posted May 4, 2005 Posted May 4, 2005 Thanks for all the info. I'm going out of town for a week, but I'll check it out when I get back.
sebastianzimmer Posted May 13, 2005 Posted May 13, 2005 I just make a Formula Field and define it as... length(the name of your container field) It works for me but I am not sure if thats what you want. You can always round that up(or down). It displays your file size in Byte, so you might want to divide by 1000 or a million. Try it?
carlschneider Posted May 13, 2005 Posted May 13, 2005 I'm not trying to get the file size. I'm trying to get the dimensions of the images, in pixels or inches. Any other suggestions? What I really want is for my database to automatically determine if an images is vertical, horizontal, or square. I just figured this was the first step, but maybe there is another way.
sebastianzimmer Posted May 14, 2005 Posted May 14, 2005 thats right, I am sorry, I should have read the post more carefully. I like Fenton method, does it work for you?
Recommended Posts
This topic is 7197 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 accountSign in
Already have an account? Sign in here.
Sign In Now