Thank you for the post.
I am unable to replicate. To attempt to replicate, I performed the following steps:
1. Opened FileMaker Pro 12
2. File > New Database > "Thumbnail.fmp12" > Save
3. Created two container fields: container (secure storage) & container copy (secure storage)
4. Created a New Record
5. Dragged a .png file in field container ( Dimension 203 X 274 )
6. Added a button to the layout with the following script:
Set Field [Thumbnail::container copy; GetThumbnail ( Thumbnail::container ; 101 ; 137)]
7. Clicked the button and container copy showed the image at half size
8. Exported field contents of container copy
Actual Result: New image is smaller in size and shows dimension specified above.
9. Next, I tested the same file with FileMaker Pro 13.
10. Next, I rebuilt the file with FileMaker Pro 13 following steps 2 - 8 above.
Actual Result: New image is smaller in size and shows same dimension specified above.
Additionally, I tested both Mac OS X 10.8.5 and Mac OS X 10.10.2 with the same results.
Perhaps, I am missing a step to replicate?
Thanks for the response.
I just tried the same steps with a brand new database exactly like you did and that does work for me as well - oddly enough.
I guess it must have something to do with the file itself, which I believe started out as a FM11 project, then moved to FM12, adding the new functionality and finally FM13, where it stopped working.
In the next few hours I'll try the same routing adding 2 more container fields in the same table in the same db as I'm experiencing problems. See if that does work or not.
Also it might have something to do with the way i load the picture in the container field the first time?
1. I start out with a bung of variables which are representing directories and files, basically forming the exact path starting with 'imagemac:..' so that the user doesn't have to go through the dialog boxes. That is stored as a calculation field with a result of Container.
2. that way i can put in on a layout and show it as a picture to the user - as a verification that it the path does point to the proper file
3. then i have a script that goes to the 'real' picture container file and does an insert picture with the calculated path as variable as the parameter.
4. last step is resetting the field with a smaller version
Again I never tried this whole approach on a brand new file with a single table. So I'll try that next.
I just thought i could run the same exact file the same way in FM13 as it did in FM12, which it doesn't.
i'll be back with an update tomorrow.
Ok think I found something.
It does work in my old file, nothings wrong there.
But there appears to be a limit to the dimensions you can pass on to GetThumbnail.
I found that from a width and height of higher then 527 pixels the GetThumbnail function doesn't do anything anymore.
Give it a value below that and it will work normally.
TSFalcon, in the file you created please make the dimensions variable by using an input field.
For instance I added a field and loaded the value into a variable like this:
1. Set Variable [$dim; Value:ThumbTest::input]
2. Set Field [ThumbTest::Picture Copy; GetThumbnail (ThumbTest::Picture; $dim; $dim )]
This works fine for $dim values up until 527, but I happen to want to scale my pictures to 600x700 pixels and then it doesn't work - anymore. (even in a brand test file created in FMP13)
But it DID work in FMP12.
Is this expected behaviour?
Thank you for the reply.
“This works fine for $dim values up until 527, but I happen to want to scale my pictures to 600x700 pixels and then it doesn't work - anymore.”
Like suggested, I made the dimensions variables via a number field and my results were the same in both FileMaker Pro 12 and FileMaker Pro 13. Also, 527 x 527 did not break because my image was originally 1920 X 1200. Both FileMaker Pro 13 and FileMaker Pro 12 produced an image 527 × 329.
What was the original size of your test image?
In my test, I noticed that specifying dimensions larger than the original will produce a thumbnail image the size of the original image. In other words, FileMaker Pro cannot create a thumbnail larger than the original image file. This behavior was identical in both FileMaker Pro 12 and FileMaker Pro 13.
Please let me know if I missed anything or if any of the above requires further clarification.
I definitely don't want to make my picture bigger.
The original size is the test picture is 527x790 @ 100dpi.
I want to turn that into a picture that fits in a rectangle of 600x700 pixels @ 72dpi.
The same file does work in FMP12 but not in FMP13.
From a requested size of 528 pixels onwards it stops working.
I just tried with a different picture that's 525x790 @72dpi and there it stops working if I give a $dim of 526...
So i think i got it now. The spec says GetThumbnail maintains the aspect ratio, so that made me believe that if i want to scale down a picture of 527x790 into a rectangle that has a maximum width of 600 and a maximum height of 700, I actually need to check if either requested dimensions isn't higher that the original image - even if the resulting image would be smaller.
That must be the difference between FM12 and 13.
Because i have pictures that have sometime a higher width then height and sometime the reverse, but i want the resulting image to fit a 600 by 700 rectangle, I will have to check the dimensions before trying to scale it.
Maybe you could add something like that to the documentation?
Thanks for your time.
Your suggestion to have better documentation for thumbnails not being larger than the original, has been forwarded to the Documentation manager.