Jump to content
Slater

Will FMP18 FILL a container field with a picture, rather than FIT it

Recommended Posts

Hi All,

Apologies for perhaps being in the wrong part fo the forums for this query!

I'm on FMP16 right now, and I've a container field that I use to display square pictures of people. Due to different layouts, the container is landscape on one, and portrait on another (ie wider on one, and taller on another). Because the only option in FMP 16 is to FIT the image, when the container is wider than tall, either the image is distorted or there are gaps on the sides, depending on whether I've got the 'maintain  proportions' box checked or not. And similarly, when the container is taller, then the image is either distorted or there are gaps on the top and bottom.

What I'm after is being able to FILL the container, so that whilst I loose a bit of the image on the sides or tops, the container is filled without distortion. Is this possible with FMP 18? (If there's a work around for FMP 16 I'd love to know it, but I don't think there is!!)

Many thanks in advance :)

 

584157452_Screenshot2020-01-10at10_03_50.jpg.0395ca946833811add48131c984409d0.jpg

Share this post


Link to post
Share on other sites

Thanks but sadly that doesn't work. The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio. And so because of this, when I show that thumb in the layout, I have the same problems as before :(

Share this post


Link to post
Share on other sites

Thanks Comment.

It's a portal where each person has a portal row, so I have to keep it in FM. And in some layouts the best shape for the container is tall, and in some other layouts it's wide ... and I guess I can't have Fill as things stand.

I've been researching it a bit, and here's an old post that sums it up very well. It can be done for a graphic fill, but not a container :( https://community.filemaker.com/en/s/idea/0870H000000fyddQAA It's from 3 years ago, and so whilst I think it's the most sensible thing in the world, and something that it's crazy not to have, I guess Filemaker don't think the same way!

It's one of those ones where I think everyone must have the same issue, but I guess not. I'll try to let it go 🤯

Here's another one post where someone from FM seems to be saying that it can't happen: https://community.filemaker.com/en/s/question/0D50H00006ti3ctSAA/how-do-i-change-how-an-image-displays-in-a-container-field

I wish I could think of a workaround, but because I have the need for a taller container sometimes, and a wider container other times, I guess not 😱

Share this post


Link to post
Share on other sites
15 hours ago, Slater said:

Thanks but sadly that doesn't work. The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio. And so because of this, when I show that thumb in the layout, I have the same problems as before :(

I just tested this and it seems to work. Change the display field to "crop to frame" rather than reduce/enlarge, and then use GetThumbnail to set the image size to slightly bigger than the field's dimensions. You said you didn't want to change the aspect ratio.

Share this post


Link to post
Share on other sites

Thanks Comment and thanks Fitch.

Great idea to check out plug ins. I've had a quick look.

Also, really cool of you to have got back to me Fitch. I've had a play with this, and this won't work if the original picture is smaller than the container. In that case, it seems to me, GetThumbnail won't work, which is why it didn't seem to be working for me, when I checked it out. The particular layout that I was using meant that it didn't appear to be working.

But if the original is larger, then it does!!

Yay, thanks Fitch, that seems to do the job ... now to resize all the originals that are too small 😳🤓

Share this post


Link to post
Share on other sites

Also, just FYI there are some problems with this if the images are different sizes. GetThumbnail only returns a consistently sized thumbnail when the originals are the same size. So if your library of images are different sizes, then you will need to plug in different values to the GetThumbnail function.

The toss up being that this will only work seamlessly if all of you images are exactly the same size. (It's better than the default situation though, so I'm not complaining!) 

Share this post


Link to post
Share on other sites

Earlier I was confused by your saying:

On 1/14/2020 at 7:29 PM, Slater said:

The function just resizes the image with the same proportions, so it effectively changes the pixel count but no the aspect ratio.

But in fact you do NOT want to change the aspect ratio, so that's not a good reason why the GetThumbnail() function wouldn't work for you. I might be reluctant to use it for reasons of image quality, but if this is for on-screen display only (and there is no requirement for a hi-res on-screen display), it can work.

 

On 1/15/2020 at 1:36 PM, Slater said:

there are some problems with this if the images are different sizes.

There should be no problems with this because the target size (or rather the size limits, if you're using  the GetThumbnail() function) can be calculated using the source image dimensions as the input. These dimensions can be retrieved using the GetHeight() and GetWidth() functions as well as the GetContainerAttribute() functions.

If you like, you can make this completely dynamic by giving the target container an object name and getting its dimensions via the GetLayoutObjectAttribute() function. Then the calculation can automatically adjust the size to fit the size of the target container on the current layout (but then it must be unstored).

 

On 1/15/2020 at 11:52 AM, Slater said:

now to resize all the originals that are too small

I would be careful with that. Resizing an image results in permanent loss of quality.

 

Edited by comment

Share this post


Link to post
Share on other sites
On 1/17/2020 at 9:05 PM, comment said:

There should be no problems with this because the target size (or rather the size limits, if you're using  the GetThumbnail() function) can be calculated using the source image dimensions as the input. These dimensions can be retrieved using the GetHeight() and GetWidth() functions as well as the GetContainerAttribute() functions.

If you like, you can make this completely dynamic by giving the target container an object name and getting its dimensions via the GetLayoutObjectAttribute() function. Then the calculation can automatically adjust the size to fit the size of the target container on the current layout (but then it must be unstored).

 

Thanks Comment, as ever! Apologies for my late reply, I've been tied up with something.

That's such a cool way to go about it. I think I could create three outputs, 3x2, 2x3 and 1x1, and then just standardise all containers so that they're one of those three.

Thanks for helping me figure this, cheers :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By St3v1e
      Hi,
      As a complete novice to FMP, I'm attempting my very first database. We rely on storing our contracts on Google & Dropbox. I've been trying to either embed the pdf's into a "tab", or (my preferred option) to have an "Add URL" button to link to the online pdf.
      I tried adding a field and copying and pasting the URL, but it's not clickable, and I'd need to add another field for each pdf/contract.
      Is there a better more efficient way to do this?
      Thanks
      Steve
    • By johnmarcel
      I have setup a layer with web viewer. I can maneuver within the website just fine but, I would like it if when the website loads it would send 4 carriage returns to get to a specific field within the website.
      If anyone has any ideas on how I can accomplish this it would be greatly appreciated.
       
      Thank You
      John
    • By john renfrew
      Have copied a shell script which works in other settings onto a new machine
      Changes paths - it zips a backup folder and does a ditto command to copy as a zip file to an external drive
      I worked out that I needed to change the sudoers file to allow no password access to the script. Running the shell script in terminal was requiring a password, now it doesn't 
      Added the fmserver user to that too.
       
      If I run the sh script from the admin console as fmserver it fails straight away, if I run it as the local user with its password it appears to run but in fact times out with a fail message, both of which are about invalid account name or password
       
      The script is working fine when run through terminal, doe not require password, just not when triggered from console.
      Does anyone have any light to shine on this???
    • By Otis
      Actually, I guess this could apply to macOS Mojave as well, but is there any way to get the Send Email script to work when creating a Runtime solution in macOS Catalina?
      I'm using FileMaker Pro Advanced 18 to create my runtime solution. I created a button on my main menu to send an email. When I click the button in High Sierra (and all previous macOS versions) it works. But in macOS Mojave and Catalina, nothing happens.
      I know that Apple placed security limits on applications, but there's no way to add my runtime to the list of allowable applications to execute a script. What is supposed to happen is that macOS is supposed to have a pop up that allows you to click to allow this application to run scripts and access mail.app. So this works in FileMaker Pro Advanced 18. However, when I covert my solution to a Runtime, it's no longer "FileMaker Pro Advanced" and instead is considered a Runtime app.
      In macOS Catalina, manually adding my runtime solution to this area didn't work: System Preferences > Security & Privacy > Privacy (tab) > Accessibility > (Allow these apps below to control your computer)
      Is there any way to allow a runtime to have a simple button to click Send Email in Catalina?
      I'm stumped.
    • By Faldo
      Good morning
      I was wondering if anyone had template for a basic home accounts sytem or the schema for the databases.
      Thanks again.
       
  • Who Viewed the Topic

×
×
  • Create New...

Important Information

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