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

Resize images proportionately?


ErnieG

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

Recommended Posts

I have an image for each file in a museum database, sized for single-page view. I'd like to include a thumbnail version in a report form.

Applying fixed width/height values will distort them, since some are tall and some are wide. I tried % values, but that's interpreted as a percent of the size of the cell. Any ideas on code for proportional resizing or else "locking" the cell size to constrain the images?

Thanks again!

Ernie

Link to comment
Share on other sites

Thanks for the quick response! I just tried it again, to be sure, and without sizes my IE 5.1 on the Mac feels free to show the images at full size.

Sorry I wasn't more clear, Unable. I already have an 8" version for a "view large" form, plus a 3" version (either tall or wide). I was hoping there was a simple way I'd missed that would show the 3" version at something like 3/4".

Oh well, fortunately PhotoShop has a batch command. Looks like I just need to make a new batch (of 1500 or so) at a different size?

You mention storing the images, by the way. I HAD been doing that, storing the images in the DB. But I'm remembering vaguely a previous post. Is it significantly faster to store a URL and call that instead of importing an image from a container field?

Ernie

Link to comment
Share on other sites

Not that it is any faster or slower, but why store the images in the db file and thus fill the db with all that required memory for the images. They can be stored in the format file folder or elsewhere and referenced with an appropriate path from the records, keeping db file memory available for "cheaper" data. Before he stopped contributing here, Keith Davie donated a Sample File on serving images on the web which you may find useful. Check the Sample File Forum.

Link to comment
Share on other sites

Might I suggest that you check the dimensions of the image on import into the database, and if the dimensions are not what is required, resize the image at that point. You can also standardize the degree of compression.

AppleScript and GraphicConverter is a wonderful means to do this.

Link to comment
Share on other sites

I'll look into PHP, which may be the answer, but I have the feeling I was still unclear on what I'm trying to do, since it's not about "checking" an image. In case others will some day run into this, and at the risk of beating a dead horse:

I have a table cell that is 50 pixels by 50 pixels. In it I have

________________

<img src="[FMP-Image:Image]" align="center" valign="center">

_________________

"Image" is a container field in my database that holds a series of random images, some of them 3 inches wide and some 3 inches high. I had hoped that there was some CDML or HTML attribute in <imgsrc> that would reduce the graphic to fit in the cell, retaining its original proportions. (width="50" height="50" will just stretch the non-square graphics.)

Sorry for the confusion.

Ernie

Link to comment
Share on other sites

"Not that it is any faster or slower, but why store the images in..."

I have to dissagree with this...any time you pull an object such as an image from the DB it will return as such...(eg. filtering for a digit vs. text+extention text "image_name.jpg")remember text=AaBb... while digit=0123..9 period

if I remember correctly it is faster to pull references to files than files themselves (eg. field:image "c:imagescontainer_1image_name.jpg"). This does make a difference on SQL based platforms...so I would imagine it applys to FM.

But then again, I have been wrong about many things in my life...wouldn't be the 1st time smile.gif

Link to comment
Share on other sites

to scale images proportionally in HTML, just give ONE dimension, omitting the other,

Only problem is to determine whether the image is portrait or landscape,

And keep your images separate, referencing the path only.

rendering can be up to 500 times slower in WebCompanion, because images stored in FileMaker will be rendered to an offscreen pixmap, then converted into a gif or jpeg, them interpreted by the web browser. it is even worse with images stored as reference, because the time it takes fm to fetch the pix is added.

i keep may images on an image server and use a simple perl script to determine the size. images are then displayed by

<img src=."./cgi-bin/image.cgi?pix04726">

Link to comment
Share on other sites

Also you might consider doing a "thumb" approach with FMP-If statement where on the results page you could use 2 small images rather than displaying the actual image from the db. Example:

______________thery_____________________

IF filed "image" is not empty then show "some_small_image.jpg"

IF field "image" is empty(no image associated with the file) then show "other_small_image.jp"

______________________________________

------code------------------------------

[FMP-If: image .eq.]

<img src="/images/imageNO.gif" width="18" height="18" border="0">

[FMP-Else]

<img src="/images/imageOK.gif" width="18" height="18" border="0">

[/FMP-If]

-----------------------------------------

and then when a user clicks on "details" associated with the record you would be pulling just that one image at the time!

Hope it helps!

Link to comment
Share on other sites

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