Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 4804 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi forum

I'm using this function to generate a thumbnail:

ImageThumbFromURL( Substitute( $Pfad ; "\\"; "\\\\"); 140 )

This works perfectly well no matter whether $Pfad is a URL or a local path in Windows runtimes, in Filemaker Advanced on Windows an on Mac 10.6 and 10.7

The same code executed in a runtime on Mac generates nothing but the text "ERROR" in the thumbnail field. The plugin ist loaded and visible in the list of plugins.

Any ideas?

Posted

Hi Brent

I try to produce the report on the mac tomorrow. The function I use is this, I found it somewhere in the forums:

RegisterGroovy( "ImageThumbFromURL( url ; maxpixels )" ; "import javax.imageio.ImageIO¶

import java.awt.image.BufferedImage¶

import java.awt.geom.AffineTransform¶

import java.awt.image.AffineTransformOp¶

BufferedImage img¶

if (url.indexOf("://") != -1) {¶

img = ImageIO.read(new URL(url))¶

} else {¶

img = ImageIO.read(new File(url))¶

Integer maxWH = img.getWidth()¶

if (img.getHeight() > maxWH){¶

maxWH = img.getHeight()¶

Double thumbscale = Double.parseDouble(maxpixels) / maxWH ¶

AffineTransform transform = AffineTransform.getScaleInstance(thumbscale, thumbscale)¶

AffineTransformOp op = new AffineTransformOp(transform,null)¶

BufferedImage scaledImage = op.filter(img, null)¶

return scaledImage" )

Posted

"ERROR" means Java throws an exception.

WIth the function SMLastError you can get more details about this exception. Just put a "Show Custom Dialog" script step after your function call that shows SMLastError.

Posted

WIth the function SMLastError you can get more details about this exception. Just put a "Show Custom Dialog" script step after your function call that shows SMLastError.

I made a mistake here, it doesnt work with the full version either. SMLastError is "javax.imageio.IIOException: can't read input file" with $Path reading like "MacDisk:library:test.jpg". I guess I have to transforme the path first?

This topic is 4804 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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