Resizing images - portrait and landscape

Hi,
I am uploading and resizing images(see code), I want to
resize them to 200px by 150px if landscape and 150px by 200px if
portrait. How can I determine the orientation of the image?

Well, first of all you would need to know what the initial
image dimensions are. And the way to do this is to get the current
images height and width from reading the image. You would then
compare the width number to the height number and if the width is
greater than the height, you know that it's more of a landscape
photo...and vice versa.
Try this code:
<cfimage action="read"
source="#expandPath("graphics/corner.png")#" name="myImage" />
<cfdump var="#variables.myImage#" />
<cfif variables.myImage.width gt
variables.myImage.height>
Landscape
<cfelseif variables.myImage.width lt
variables.myImage.height>
Portrait
<cfelseif variables.myImage.width eq
variables.myImage.height>
Square
<cfelse>
Something else for whatever reason.
</cfif>
At least, I think this is how you'd do it. I know it's not
the most elegant way...you might want to look at ColdFusion image
functions rather than reading the whole image in, I think there are
functions just to get width and height, which I imagine should give
you better performance.
Good luck,
Mikey.

Similar Messages

  • How to create a single action for adding a border and signature for portrait AND landscape images???

    i would love to be able to create a single photoshop action for adding a border, plus a signature in the bottom right corner, that works for both portrait and landscape images.
    need i say more?!
    i already have an action that adds a signature in the centre of the border at the bottom of the image e.g. the image below. what i want though is for that signature to be on the RHS and for the same action to work for portrait images as well.
    supplementary info: reason for this is that I want to be able to export 300 wedding images (mix of landscape and portrait images) from lightroom in my pre-selected order (meaning the files are labelled from 001 to 300, ordered according to how the wedding day unfolded) and then use PS to add the border and the signature, in the same place, and for it to work for both orientations.
    i need this to work for full sized exported jpeg images, i.e. i want the files that i give on CD to my clients to include my signature in this manner. so I don't want to copy the initial layer and then reduce the second layer size to leave a border around the second layer.
    i hope i've been clear and that someone can help me here. I think that this sort of presentation makes such a difference to final printed image, and I DONT want to have to go to all 300 images picking out the landscape from portrait ones (although this may be what I have to do and wouldn't really take that long but surely there's a better way!!!!).
    Thanks in advance photoshoppers ...

    It is actually quite easy to do if you have a good understanding of how Photoshop works.  To be able to handle any size Landscape and Portrait you need to scale the document to a known width or height.  Once the document is resized to the width or height it easy.  When yot resize the document you use Image size with resample NOT checked.  Not a single image pixels is changed all the happens is the documents DPI is set to the proper DPI resolution to print that size.  This lets you add a border sized for and document.  You can use Canvas Size check relative and  leatve the anchor point centered and set width and height to 2" this will add 1"on all sides. Use Canvas size a second time move the anchor point to the top center check relative and set height 1" the will add an additional 1" border on the bottom.  You then record a text layer with your Name title or what ever to the top left of the image. Select all ant the align the text layer to the selection to move it to the bottom right.
    Adding a couple of scripts to the action you can make sure there is a background layer so the added canvas will be filled with pixels.  You can restore the document to its original DPI resolution to retain the images print size. Down load my crafting actions package it contains a dozen scripts to be used within actions. There are text file with tips and guidelines additionaly there is one on dealing with document size and includes a sample action set with a watermarking action the can watermark and size image. The Action set is also saved as a text file with additional comments I added my downloads can be found here http://mouseprints.net/Photoshop.html

  • Images in portrait and landscape positioning

    In portrait mode all my images are situated perfectly with text before the image and then text after the image. In one section I only have 4 images.
    When I switch to landscape mode the images are situated in different positions - not radically different but different  enough so that the text does not 'fit' with the flow of the image-supported narrative.
    When I move the image one overlays on top of another :-/
    Or hides behind a page if I move along to the required position.
    I have deleted and re-added, moved text, created different sections so that only one image per section occurs (though this is stupidly inefficient!!) but a mess!
    How do I add images within text so that both in portrait and landscape they (the images) are positioned correctly?
    Thank you.

    Mine are currently working when set to "Inline (moves with text)" and each takes a little adjustment. This is not satisfactory for me either.  - Fabe

  • Images in Portrait and landscape

    I am trying aperture 3 on trial, I moved some images across from iphoto and now I have every image in portrait and landscape, how can I change this?

    Mine are currently working when set to "Inline (moves with text)" and each takes a little adjustment. This is not satisfactory for me either.  - Fabe

  • Resizing portrait and landscape formats

    Is it possible to resize portrait and landscape format photographs in one single batch process. So that for example all portrait formats become 800 wide and all landscape formats become 800 high? Or do i have to put them in separate folders before resizing?

      Separate folders unfortunately in Elements, unless you first rotate, which is not recommended. You can do it in Lightroom by export and simply specifying the dimension of the long side.
     

  • Portrait and landscape in the same document.

    Hi there. I'm trying to print a portfolio that has both
    portrait and landscape pages in it. I understand that I can change
    printing propoerties to print in either portrait or landscape, but
    is there any way to configure settings so that both are present in
    the same document?
    Many thanks in advance.
    Regards
    irthom

    You can't do that in Pages. You either have portrait or landscape orientation of the pages. What you can do is rotating the content of the page if it is an image, objet or table.
    If the document is for reading on the screen you can export the document to PDF and in Preview rotate the page.

  • A single report can't combine portrait and landscape oriented pages

    Post Author: joelo2
    CA Forum: Crystal Reports
    Hi,
    Can a single report in Crystal report XI (version 11.5.8.826) combine portriat and landscape oriented pages like Crystal report 2008?   For example, I have one main report with several subreports in the main report.  I want one subreport be in portrait page orientation and the other subreports in landscape.  Can I do something like that in Crystal report XI version?    I even tried writing a small .net program to do this, but it doesn't seem to allow me to do that programmatically either.  Please help

    Post Author: ngra
    CA Forum: Crystal Reports
    I'd like to elevate this issue with Crystal Reports XI. There is a critical application which we developed in-house which needs both portrait and landscape orientation in each of the 30,000 plus documents we are sending out every month.If developers in Business Objects are picking this thread up - we need a patch for this limitation - quick. Right now, we are toying with the possibility of exporting the documents into a text format with markers indicating if a page is portrait or landscape. This is to be loaded into a Xerox machine (which costs hundreds of thousands of dollars), where it is mapped automatically to portrait or landscape. Note to Business Objects: This will provide us and countless others with much value. Think 80/20 rule - most bang for your development bucks and value for your customers!

  • When Pages will support portrait and landscape page orientation in the same document?

    When Pages will finnaly support portrait and landscape page orientation in the same document?

    Only Apple would know, and it isn't telling.
    Peter

  • Printing Document w/ both portrait and landscape pages

    After some searching, I was able to create PDF forms with LiveCycle that had a mix of portrait and landscape content.
    However, when I go to print the document from Acrobat Professional 8.0, it prints the landscape pages in portrait mode, thus cutting off the right side of the page.
    When printing on computers with only Acrobat Reader, the pages all print properly. Is there a way to fix this?

    If you just want a page the same size as the rest of the report but with the text printed sideways, you can do that in Pages.
    If you want a fold out page (2 sheets wide) then you will have to make a second document for the wider sheet and, after skipping a page in the original, manually insert it after printing.
    Alternatively the material can be scaled down to fit.
    Hopefully in Pages '10 we will get spreads.
    …as well as real color management, crop marks, spot color, slugs, direct selection tool, ability to select objects under other objects, a usable drawing tool, object library, user created shapes, convert text to outline…

  • Word 2007 mail merge : problem with mixed portrait and landscape orientations

    Hi there,
    I have a 3 pages document Word 2007 file
    This is a mail merge I want to export in PDF using Adobe Acrobat Printer,
    then send "big" PDF to printing.
    page 1 is PORTRAIT
    page 2 is PORTRAIT
    page 3 is LANDSCAPE
    In PDF pages 1 and 2 are perfectly fine, inside an A4 format (width=210 height=297mm or something)
    but for page 3, system changed to a "double" sized page (A3 width=297 height=420) and printed my stuff at the 1st top middle of big page.
    So I have a big "double" sheet, oriented PORTRAIT, with my stuff in 1st half, and a blank in 2nd half.
    It seems that system did not rotate the page... and just put the stuff into a bigger sheet to "solve" at best.
    I would like the same size of paper (A4) but in landscape : width=297 height=210
    I have already seen many PDF with mixed portrait and landscape orientations, so what's the thing ?
    With my advanced thanks,
    And greetings from Paris, France !
    Vince

    Some questions:
    Which version of office were you using before? 2003?
    Are the data files on a network, or on your local machine? If they are on a network, can you make a copy of one of them on your local machine and try again?
    Can you open the files directly in Excel? What extension do they have (.xls, or something else?) I am wondering whether access to other file types has been left blocked on your machine but is allowed on your colleague's machine.
    Are you just opening the mail merge main document and seeing this message? If so, do you see the same thing if you start with a new document and try to connect to one of these data sources?
    Can you confirm that the message is about Access even though you are trying to connect to an Excel file?
    (Also, office 2007 has some new stuff - that let's you specify that certain folders are "trusted" . I don't think that ever affected MailMerge but it may be as well to make sure that your documents and data sources are in trusted locations).
    Also worth trying to start Word in "Safe mode" - see, e.g. http://office.microsoft.com/en-gb/word-help/work-with-office-safe-modes-HP010140792.aspx
    Peter Jamieson

  • Section header with portrait and landscape view

    My iBook project is being created so that it is available in both portrait and landscape view. This has been a tricky process since alot of content was distored when I created the layout using landscape and then attempted to adjust the portrait view after that. Currently, after many adjustments, I am attempting to remove the small "section number header" throughout the book at the very top of each chapter header in portrait mode. I was able to remove the the section number from the landscape mode, but can't seem to figure out how to do so with portrait mode (or if it is even possible?)
    Help and suggestions are greatly appreciated.

    Remember....layout in landscape - edit content in portrait.
    Did you try to select the section number header in the style drawer and remove it from the master layout?

  • Can all Acrobat Readers open files with mixed orientation pages (portrait and landscape)?

    Can all Acrobat Readers open files with mixed orientation pages (portrait and landscape)? If not, which versions can? Thanks!

    Hi Sami,
    You can open files with mixed page orientations in all Adobe Readers There is no such constraint on opening files with different page orientations in Adobe Readers.
    In case if you have any other query please let us know. We will be happy to assist you.
    Regards,
    Aadesh

  • Smartfroms for portrait and landscape format

    Hi Experts,
    can we able to create a form in two different format (Portrait and landscape) in a smartform. If any one have idea, Please assist me on the issue? if we can, can we able to extend secondary window for next page or not?
    Appreciate your aid in advance.
    Ram.

    Hi Sharin,
    Thank you for your response.
    yes, you right we can use both formats (portrait and land scape) in one smartform. But, here my probelm is when i use two main windows with difrerent main window size (width), the SAP system is not accepting. and even the page break also not working in secondary window.
    I want to display some number of forms with different format (say portrait and land scape). In this case the main window size is different. so how we can achieve solution for this issue.
    if you have any idea, please share with me.
    Thanks for your reply in advance.
    Ram.

  • My Portrait and Landscape is lock. icon in status bar double tap home button to unlock there no multi-task bar how do i unlock this

    My Portrait and Landscape is lock, icon in the status bar. Tried the double tap home button. there no multi-task bar to unlock

    dg8wood wrote:
    THANK YOU... This was driving me CRAZY.. how do I do the green check
    You seem to have succeeded with the green check. Glad you got everything figured out!

  • How to design an iPhone app that uses both Portrait and Landscape in Flash CS6

    So I have created an App that has a different menu when it is held portrait, but changes when held landscape. I can get the navigation to work, However I am unsure how to design landscape pages inside Flash?
    My stage is set to the standard 640x960 air for iOS, which gives me perfect portrait pages, But when I tilt my phone to landscape the screen obviously changes, and it looks weird. Im hoping someone can tell me how i can get this view inside Flash, while still having the portrait screens too?
    I want to have both Portrait and Landscape in the same app, and am currently so confused how I can design this inside flash?
    I hope this makes sense, and that someone could throw some help my way!

    you can change the display depending on stage orientation but it doesn't make sense to "..swap the stage orientation between screens".
    to change the display, use a StageOrientationEvent.ORIENTATION_CHANGE event and listener:
    stage.addEventListener("orientationChange", orientationChangeF);
    function orientationChangeFr(e:StageOrientationEvent):void{
    trace(e.afterOrientation.toString());

Maybe you are looking for

  • DW8 says there's no margin, but the image is still 10 or so pixels off

    Okay, so I'm new to DW and am using DW8 (what's the newest version anyway?) Here's the background and my problem: I'm working with a graphics designer in redesigning the site for our non-profit organization, and she has a gradient along the left side

  • Saving sessions in the database...

    Hi there, I'm trying to save a session object ( not a J2EE session but a custom one ) in an Oracle database. I save the session in a table with a BLOB column and some other varchar columns... Whenever I want to write a blob, the application freezes..

  • Can I embed OpenType fonts in Flash CS 5.5?

    I just reopened an old-ish Flash project and the fonts aren't working. The project was worked on previously in CS 3 or 4 - don't recall - on a Mac running some earlier version of OS X. I'm currently running Lion and Flash CS 5.5, and some of the font

  • Installing Functional Module as a Customer Extension

    Hi All, Am not a Basis guy and have stuck up in a issue at customer place. I need to import, install and activate function module as transport into the R/3 system. In Note # 1050096, there is a attachment with two files K900947.SM0 R900947.SM0 I need

  • Problem with sqlplus when called from forms

    Dear friends, I have the following problem, we are using forms 10g and database 10g,we are using client_host command to call sqlplus from form and the query which is being run by sqlplus is supposed to take an input from the client and return results