December 5, 201114 yr 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?
December 5, 201114 yr Is this a module you wrote yourself? If you can reproduce the error and send us a bug report we can take a look and see if we can identify the issue.
December 5, 201114 yr Author 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" )
December 6, 201114 yr "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.
December 6, 201114 yr Author 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?
December 6, 201114 yr Author Problem solved, with a path like /Volumes/MacDisk/Library/test.jpg everything is fine
Create an account or sign in to comment