Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Rotating an image in a container


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

Recommended Posts

Hi,

There are several ways to achieve scripted rotation of container field contents.

An FMP native procedure - since there is no direct script command for rotation of container images - requires a slightly 'lateral' solution, but it can be done. In fact there is a free demo file available from my web site which shows an example set-up. If you're interested, the demo can be downloaded from the following URL:

http://www.nightwing.com.au/FileMaker/Demos/RotateImage.zip

Note that the method illustrated in the free download (above) enables rotation of a file through 360 degrees in 90 degree increments. The demo file is set up to handle rotation of an image at screen resolution (72dpi), however the technique can also be adapted to rotate scaled images (at full resolution) if required.

If you require greater flexibility, you might want to check out the plug-in options. Plug-ins such as Troi Graphic (from Troi Automatisering - http://www.troi.com/software/graphplugin.html ) provide some extensions of the options to control procedures such as image rotation.

Link to comment
Share on other sites

Thanks for the reply. I checked out the nightwing one, interesting way to do it, but the quality suffers. I'm trying to keep teh quality up. I've checked out the troi plug-ins in the past, and unfortunatly any image altering one is mac only =(. I'm PC.

-j

Link to comment
Share on other sites

Hi,

As I indicated in my previous post, the demo is 'tuned' for 72dpi images. If you try to use it with other resolutions, quality will indeed suffer. However if you adjust an implementation to deal with other (higher) resolutions, then quality should not be affected.

Also, I'm not sure why you have the impression that the Troi plug-ins are Mac only. They are not. I have a copy of Troi Graphic (the one I gave the URL for in my previous post) that is fully x-plat. I have been using it on Windows and x-plat solutions for several years.

Link to comment
Share on other sites

The plug-ins are indeed cross platform, but some of the functions are mac only

From the troi website: "rotate pictures before grabbing (Mac OS only)"

How can i go about tweaking your rotation setup for higher resoultions? I've been having some strange cropping issues with it as well.

Thanks

Link to comment
Share on other sites

The plug-in I referred to was Troi Graphic, and all of its functions are fully cross-platform.

The reference you have quoted from the Troi website is from their 'Grabber' plug-in which does not deal with graphics or image manipulation per se, but with image capture from external sources. As far as I am aware it would be of no value for modifying container field contents, whereas Troi Graphic plug-in most definitely is.

The demo is just that - meant to be indicative of the technique, but not to exhaustively elaborate every possible permutation. As you've seen, it is configured to deal with 72pdi images of a specific size (268 x 268 pixels) - and in that configuration does not give expected results if you feed it a different diet.

The technique, when relying solely on FMP-native processes, depends upon the preview function - which in turn is dependent on paramenters from the currently installed printer driver, because it captures a previewed page. In order to set it up for scaled (high res) images, you need to first specify a custom page size which exactly matches the actual dimensions of the image at full screen resolution. That page setup must then be saved with the script.

Once the page setup matches the image size, the copy of the container on the 'snapshot' layout must also be set to exactly the same size, the custom margins for the snapshot layout must be set to zero all 'round, and the rotated container must be set for the 'crop' graphic format to ensure that *no* scaling of the image will occur at the point of capture (as it is scaling at the point of capture which may give rise to image degradation).

The display containers on other layouts can then be set to scale the image, and the rotation capture procedure will capture the image at full resolution without any degradation.

This procedure is fine for images of a given resolution. If you need to be able to deal with more than one image resolution, you will need a separate script for each.

The chief limitation of this approach (ie the fully FMP-native version of the technique) is that in dealing with scaled images, it is dependent on the installed printer driver and the custom page settings. If it is used with the wrong driver or a driver that is not configured to support the required/specified custom page sizes, unintended cropping or scaling may occur. In this respect, the technique is not as portable nor as flexible as may be requried for some solutions.

When I referred to additional flexibility using the Troi Graphic plug-in, I was referring to the fact that Troi Graphic can capture a predefined (or dynamically determined) screen area regardless of the installed print driver or page setup settings. Thus a similar technique can be used, but can be largely freed from its dependency on driver and page size settings, making it possible to configure a set of rotation scripts for high res and scaled images which are more 'portable' and robust.

Link to comment
Share on other sites

Here's a crazy thought:

Create four copies of the image, rotated 90 degrees each time. Then import them into four "Import" container fields in another layout. Then create a container field that auto-enters one of the imported graphics, and a script/button that changes the contents of the field to equal one of the other imported graphics. It'll look like you're rotating the graphic, but you're really just exchanging them.

It may be more work on the front end, but quality shouldn't suffer.

Link to comment
Share on other sites

Here's a crazy thought:

Create four copies of the image, rotated 90 degrees each time. Then import them into four "Import" container fields in another layout. Then create a container field that auto-enters one of the imported graphics, and a script/button that changes the contents of the field to equal one of the other imported graphics. It'll look like you're rotating the graphic, but you're really just exchanging them.

It may be more work on the front end, but quality shouldn't suffer.

The idea is good, but the images aren't rotated to begin with. I wanted FM to do all my rotating for me.

Link to comment
Share on other sites

I hate to be a pesk, but your life (manipulating images) would be a lot easier if you just broke down and got a mac. FM really is cross-platform and one mac machine on a windows network is easy to support.

[Just looked at the nightwing demo... pretty slick.]

Link to comment
Share on other sites

I hate to be a pesk, but your life (manipulating images) would be a lot easier if you just broke down and got a mac. FM really is cross-platform and one mac machine on a windows network is easy to support.

I know, i know. I'm just workign on a minimal budget and a $80 plug-in is a lot more appealing than a few hundred for a mac + software license.

Unless you're willing to donate one to a "somewhat-unworthy cause" =).

Thanks

-j

Link to comment
Share on other sites

The plug-in I referred to was Troi Graphic, and all of its functions are fully cross-platform.

Incorrect, the rotation fucntion, as it says on the web page, is mac only.

http://www.troi.com/software/grabberdetails.html

Additional Features

Rotate your image*

You can now rotate the image 90, -90 or 180 degrees. With this you can not only capture images in landscape but also capture images in portrait orientation.

* Currently for Mac OS only.

Link to comment
Share on other sites

Hi jfmcel,

While I'm all for platform diversity, I fail to see how being on a mac would help nightdesigns in this instance. FM (like many applications) may handle graphics a little more smoothly and display them with greater consistency on the Mac, but it doesn't offer additional graphics commands or capabilities as such.

There is no secret 'Rotate Field Contents ["90

Link to comment
Share on other sites

Incorrect, the rotation fucntion, as it says on the web page, is mac only.

http://www.troi.com/software/grabberdetails.html

Additional Features

Rotate your image*

You can now rotate the image 90, -90 or 180 degrees. With this you can not only capture images in landscape but also capture images in portrait orientation.

* Currently for Mac OS only.

Troi Graphic does not even *have* a rotation function. As I pointed out previously, the page you were looking at (and which you've just given the URL for) is not for Troi Graphic, but for the 'Grabber' plug-in, which is not an image manipulation plug-in, but is for capturing data from external devices.

Link to comment
Share on other sites

Troi Graphic does not even *have* a rotation function. As I pointed out previously, the page you were looking at (and which you've just given the URL for) is not for Troi Graphic, but for the 'Grabber' plug-in, which is not an image manipulation plug-in, but is for capturing data from external devices.

You're right. I've spent too many long nights with too much caffiene pumping through my veins. I applogize. Now back to the question. Anyone willing to make a plug-in to rotate the graphics? I'd be your first customer.

-j

Link to comment
Share on other sites

CobaltSky, i like your idea, unfortunatly for me, the images are not a consistent size. Is there no one that makes a plug-in to rotate an image in a container?

OK, If the images are not of a consistent size (or at least a number of defined sizes that you could script for) then I guess we've established that that technique is not suitable in this instance.

I'm afraid that I'm not aware of any plug-ins that will rotate container field contents.

However in the meantime (while you're waiting for someone to write one) there is a slightly different texhnique that you might consider.

The drawback (or advantage, depending on your point of view) of this approach is that the original image will not be altered in any way - just diaplayed in different orientations as chosen/specified by the user.

Attached is a slightly different species of demo which shows the alternative approach.

Because of the way this one works (and because the original image is not being altered) there is no loss of resolution and it can be set up to handle scaled inages just as well as screen-resolution images.

I'll be intersted to hear whether this alternative is of any greater value to you than the last. smile.gif

RotateImageDisplay.zip

Link to comment
Share on other sites

However in the meantime (while you're waiting for someone to write one) there is a slightly different texhnique that you might consider.

The drawback (or advantage, depending on your point of view) of this approach is that the original image will not be altered in any way - just diaplayed in different orientations as chosen/specified by the user.

Attached is a slightly different species of demo which shows the alternative approach.

ColbaltSky, once again, thank you for the reply and the file. Unfortunatly that won't do the job either. Let me explain what I'm doing with FM so you can get a better idea. We have a database that puts images on the web. Currently the images are taken directly onto the computer (camera is hooked to the computer) and with the "inside scan" plug in, the user and quickly and easily import all the images, click an image placement (4 possibilites) and size (2 possibilities), exports and a web page is generated and uploaded accordingly (html and pictures). I use inside scan to "preview" all the images via refrence, then open, resize, and export in a numbered sequence into another folder. No image is ever kept in filemaker, all are via refrence (to keep database files small, 50,000+ pictures on our server).

Currently the only way to rotate the image is in the capture window of the software (before it goes to FM). The user wishes to be able to use the camera anywhere (not teathered to the computer) and then put the memory card into a reader and import that way. The rotation problem comes about because i've lost the step in which the capture software allowed me to rotate the picture.

I contacted Marco Sandri today, the creator of inside scan, and asked him what are the possibilities of rotating images with his product. He told me that the next version that is in development will have that feature. So now it's just a matter of becoming buddy-buddy with him and trying to get a pre-release test copy of that.

Thanks again to all

-jacob

Link to comment
Share on other sites

Hi Jacob,

Delighted to hear that you have a solution in the works. That's great.

Must say though, that from your description, I'd have thought an adaptation of the first solution I suggested would be workable. Since there are two image sizes to deal with, you'd need two 'spashot' layouts - and to fully automate it you'd need to capture the image dimensions (eg using Troi File etc) at import and then have the script choose the appropriate snapshot layout accordingly. Then the script would have to export the rotated image (eg using ExportFM etc) to disk and reimport it as a reference. A bit of exacting scripting, but quite possible, on the face of it.

Notwithstanding that, if you can get a beta release of the forthcoming coming update of Inside Scan from Marco anytime soon, that sounds likely to be the easiest option - and should slide in nicely beside the code you already have in place. So I'll keep my fingers crossed for you. wink.gifsmile.gif

Link to comment
Share on other sites

Must say though, that from your description, I'd have thought an adaptation of the first solution I suggested would be workable. Since there are two image sizes to deal with, you'd need two 'spashot' layouts - and to fully automate it you'd need to capture the image dimensions (eg using Troi File etc) at import and then have the script choose the appropriate snapshot layout accordingly. Then the script would have to export the rotated image (eg using ExportFM etc) to disk and reimport it as a reference. A bit of exacting scripting, but quite possible, on the face of it.

It may have, but quick and easy adjustments to that doesn't seem possible. We're also looking to be doing multiple sizes in the future (up to 6) and possibly even user specified sizes. Our current solution is already set-up for that, just need to change 1 calc field.

Notwithstanding that, if you can get a beta release of the forthcoming coming update of Inside Scan from Marco anytime soon, that sounds likely to be the easiest option - and should slide in nicely beside the code you already have in place. So I'll keep my fingers crossed for you. wink.gifsmile.gif

I heard back from Marco this morning, he told me a couple of weeks. My fingers are crossed.

Thank you all for your help and continued support.

Link to comment
Share on other sites

You can scale, move, change images from FM stored to file references, get image info and ROTATE images using applescript. In addition, nightdesigns explicitly states that his is simply trying to gain Troi Grabber functionality offered to mac users on a window machine.

In a previous post nightdesigns states "We average 15,000 pictures a year, so anything to cut down on time to take and add to the record, the better." I am simply suggesting that a mac would be a reasonable investment based on both expected savings in development time and, most importantly, end user time.

Link to comment
Share on other sites

Don't get me wrong, I'm all for Macs - and use them extensively for all the graphics work we do here.

My point was simply that the references to Grabber were based on a misunderstanding - it doesn't do what Jacob had been assuming, as you'll see has been clarified in other posts on this (increasingly voluminous) thread. wink.gif

Link to comment
Share on other sites

Cobalt -- have you ever seen a "decreasingly voluminous thread" on any of these boards?

Yes, Dan, I have.

I have seen three types of voluminous threads on this board:

1. Static voluminous threads.

Threads which have bloated to such a size that no one has anything more to add (apparently);

2. Decreasingly voluminous threads.

Overblown threads where one or more contributors subsequently realise (apparently) that their contribution was fatuous or irrelevant, and delete it as a courtesy to other users; and

3. Increasingly voluminous threads

Topics which, though they have been thoroughly discussed, seem to just keep on acquiring more responses anyway.

Like this one smile.gif

Link to comment
Share on other sites

This topic is 7854 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.