Select a screening tool according to the orientation of the image

Hi guys,.

I wonder if you have Photoshop, select a screening tool according to the orientation of the image.

For example, if the selected tool is the crop tool and the "in focus" image is a landscape, it selects the tool preset "15x10cm; Once you crop and save this image, Photoshop gets to the next image, and if it is a portrait, it selects the predefined tool '10x5cm' and so on...

It is important that crop tool presets to be charged only if the crop tool is selected, because otherwise you would get the crop tool selected when you do not intend to crop the image.

Thank you very much

Ed

This is a script event handler script that will choose the crop preset depending on the orientation tool. You need to change the tool preset names to match what is on your system.

function _selectDocumentHandler(desc) {
     var currentTool = getCurrentTool();
     if( currentTool == 'cropTool' ){
          var defaultRulerUnits = app.preferences.rulerUnits;
          app.preferences.rulerUnits = Units.PIXELS;
          var doc = app.activeDocument;
          var w = doc.width;
          var h = doc.height;
          if( w>h ){
               selectPreset('Crop Tool 8 in x 6 in');
          }else{
               selectPreset('Crop Tool 6 in x 8 in');
          }
          app.preferences.rulerUnits = defaultRulerUnits;
     }
};
 function getCurrentTool(){
   var ref = new ActionReference();
   ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
   return typeIDToStringID(executeActionGet(ref).getEnumerationType(stringIDToTypeID('tool')));
};
function selectPreset(setName){
     var desc = new ActionDescriptor();
     var ref = new ActionReference();
     ref.putName( stringIDToTypeID( "toolPreset" ), setName );
     desc.putReference( charIDToTypeID( "null" ), ref );
     executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
};
try {
  if (arguments.length >= 2) {
    var desc = arguments[0];
    var event = arguments[1];
    if (event == charIDToTypeID('slct')) {
      var ref = desc.getReference(charIDToTypeID('null'));
      var cls = ref.getDesiredClass();
      if (cls == charIDToTypeID('Dcmn')) {
        _selectDocumentHandler(desc);
      }
    }
  }
} catch (e) {
  alert( "Error: " + e + ":" + e.line );
}

Tags: Photoshop

Similar Questions

  • Mac OS 10.6.8 - Photoshop CS5.1 after years of perfect use, suddenly I'm unable to select a layer by clicking on the image and select it in the layers palette.  Solve this problem for me and I'll buy you a new car.  With our thanks, David Heidelberge

    Mac OS 10.6.8 - Photoshop CS5.1

    After years of perfect use, suddenly I can't select a layer by clicking on the image and select it in the layers palette.

    Solve this problem for me and I'll buy you a new car.

    With our thanks, David Heidelberger

    Hi David

    Have you checked your settings to automatic selection in the upper left of the workspace?

  • Having difficulty using the quick selection tools to remove the images of background form. Any help appreciated

    Hi all

    I try to remove the background from images using 3 different selection tools.  I'm going fine, but eventually the images together ceases to be caught than ever the tool I use.  It is easier if you use a pro version of photoshop and not all versions of elements?  I have 11 items.

    Thank you

    -Deby

    You are welcome. If this does not work for you, consider using a mask. The goal is to preserve the foreground and hide/remove the background...

  • How to get the crop tool to crop the image in the Photoshop CC software freezes?

    Recently installed photoshop CC 2015 and when using the crop tool after pressing the check box the software takes forever and never crops the image. How can I fix it?

    OK what I did was select the crop tool and then right clicking on the icon in the upper left corner and the reset tool.

    That solved the problem.  Thanks for your help. Appreciate it.

  • Adding image to the screen only half of the image is displayed

    Hello

    I'm trying to add an image to the screen of my application, like this:

    BasicEditField _bef = new BasicEditField(){
        public void paint(Graphics _g){
    
    Bitmap _bitmap = Bitmap.getBitmapResource("3.png");
    _g.drawBitmap(0, 0,  _bitmap.getWidth(), _bitmap.getHeight(), _bitmap, 0, 0);
    
        super.paint(_g);
        }//end of paint
    };
    
    _verticalFieldManager.add(_bef);
    

    the strange thing is that only a part of the image is displayed and I don't know why! I have test it on bb 9000, so I know it has 480 x 320 and my picture is 480 x 176, so it must be shown.

    is anyone of you know what can be wrong?

    Kind regards

    Misty

    OK, I'm surprised that adding text did not work.  Apologies for suggesting it.  Can you tell me what JDE level you try and I have a go here.

    Anyway, the normal way to display a bitmap using a BitmapField.  This should always give you the entire Bitmap.  Give it a try.  You won't have to replace the paint using a BitmapField!

  • Loading screen does not change the Image

    I have a problem with the field of gif. What I'm trying to do, is show a progress screen that the problem is its not like an animation. Its as if she makes just the first frame of the gif image.

    I have load call that changes the image that some real treatment goes.

    I thnk its happens because of the event put on another thread. but I can't understand that out can you please help me? Here is my code can you please help where I encounter an error.

    DataStore.answeringThread = new AnsweringThread();
    DataStore.answeringThread.start ();

    final LoaderScreen ls = new LoaderScreen();
    ls.setShowLoader (true);
    Status.Show ("Please wait...", 10);
    UiApplication.getUiApplication () .pushScreen (ls);

    /*---*/UiApplication.getUiApplication () .invokeLater (new Runnable()
    {
    public void run()
    {
    try {}
    DataStore.answeringThread.join ();
    } catch (System.Exception e)
    {}
    UiApplication.getUiApplication () .popScreen (UiApplication.getUiApplication () .getActiveScreen ());
    UiApplication.getUiApplication () .pushScreen (new Answering());
    }
    });/*--------*/

    I am able to see screeen of loading for the first time, only to change its image as time passes but it isn't happeing instead, it makes only first image. and then the new response screen appears.

    If I comment the code between two - and - image changes as appropriate.

    Your problem is that you use a blocking operation and the Blackberry is never really painted screen.

    There are 2 possible solutions:

    (1) the blocking operation thread. This means that spawn a real thread to use UIApplication.invokeLater () instead.

    (2) paint before calling your blocking with the force operation: Ui.getUiEngine () .repaint (); It means the battery display to repaint and your screen will be permanently shown.

  • How to print photos when the display screen is white? The image is missing in it.

    How to print photos when the display screen is blank?  It shows only a white screen empty when I select the photo and press on print.

    You click on a film image in the print module? And, I guess you don't have to go to the Print module, right?  Additionally, make sure that you have chosen to make a custom package.  If you chose the custom package you need to drag and drop images and organize them.

  • Selection tool sensitive to color in a limited area of the image

    Hi all

    For my work, I am interested in the measure of the area of pixel of the dark (black) in the sub picture, even the smallest. For less complex images, I used the magic wand and the selection tools to select my black areas and have Photoshop CC 2015 do measures on my selection. The problem with the image below that I have is that there are so many blackheads and they are scattered all over the image. Non-continuous the magic wand option unfortunately does not work for me in this case, because some of the dark spots have the same color as the other dark areas in the picture. So far, I only managed to make a good choice by selecting each point individually, which is a very tedious and somewhat subjective work. What I would like is a sort of quick selection tool with a tolerance as the magic wand option, so I can just fly over areas with small black to select tasks that these. I don't think that this is available in Photoshop, I'm looking for alternatives. That would also work for me, it is to have a way to limit the area that the magic wand tool selects objects of. For example, set a small area (as one of the white ice blocks) and then use the selection option discontinuous of the wand in this ice blocks so it will only select the dark stains on the ice block. If I can do this several times and combine the selections, I should be defined as well. Is it possible to achieve such a thing in Photoshop? In other words, what I would basically is the type of features in the background removal tool, but then make a selection in the foreground based on a color. All other ideas, suggestions, tips and tricks are also welcome! I hope my question is clear and that there is a solution for my problem. I'm very new to photoshop, so please be very clear in your answer, so I can understand every step .

    Edit: I noticed that I posted this maybe in the wrong part of the forum (?), I was a bit in a hurry at work. My apologies. If there is no matter what mod around to place them in the right sub-forum, please do!

    Herded slick (PS).jpg

    It works for you?

    To see it in full screen, double click on the image.

    1 use the curves to increase the contrast

    2. place an empty layer below the image and fill it white

    3. return to the top layer, click on the layer to bring up the layer Style

    4. in the section mixture if move the top left right slider until the black dots you want are isolated.

    Also, consider using this technique after the first change the mode to grayscale

  • CS6 crop tool and the image disappears?

    I am new to CS6. Sometimes when I use the the crop tool, the picture I want to crop disappears from the display. Can not see where to place the crop so I end up with a blank screen/window. When I click on another tool, a window pop up asking me if I want to harvest? To which I click on the button 'not fit' and my image reappears. As soon as I click on the crop tool once again, the image disappears again.

    Why? What I am doing wrong? It happens not every time.

    Which sounds like you have a problem with video card driver (like a lot of similar positions in the general forum of Photoshop).

    Try to update your driver from the website of the manufacturer of the GPU video card.

  • Graphic resizing function has changed, now crops the image, why?

    I must, without knowing it, changed some settings. So far whenever I bring you in graphic, such as a png or jpg, I can resize using the selection tool (arrow) and in a corner of the image I click, hold down the shift/command (Mac) and then shrink or enlarge the size proportionally. What has changed, it is now, the image does not like that, but rather the same manoeuvre crops the image in the direction where, as in using a mask function, the image doesn't change size but the border of it changes and part of the left image not visible. I guess that there is a setting that I don't know who is doing this, but so far have not been able to understand. Anyone know?

    Any responses appreciated as very frustrating.

    Thank you

    -Richard

    Selection of content will resize itself the image but not the frame.

  • Culture to the bounds of the image.

    I have an image with a transpartent Basemap layer and a layer of the image. Is there a way I can use the crop tool to crop the image to its outer limits exactly?

    Trim in Photoshop function allows to do it quickly.

    Come on in "Image > Trim.

    Make sure you have "Transparant Pixels" and all selected parts.

  • An excerpt from CAN (can edit, change, etc.) created from a trace of the image paths? (CS6)

    Hiya Adobe community,

    This might me up a little, but a long time ago I used to use Freehand as my defacto design tool until I went to I. At that time, I also used "Rationalize" (http://www.adobe.com/products/streamline/) to perform the functions track image is today. While its results were a little rough, the software gave me the vector points, paths and acnhors that I needed. After all the traces, I could manually change the vector traces resulting.

    I have been using the CS6 tracing feature, but the only thing I can't understand for the life of me is the question of the "bounding box" for an imported picture. Whenever I have draw a drawing, tracing of AI results always placed a bounding box around the area of the vectorized image. My goal: to locate an item, get rid of the bounding box and extract contours and paths so that I can then change to my link.

    Is this possible? Im sure it is possible... I can not find how. (Or I do the wishes of crack?) Everything I have said, if Streamline allowed me to change the track paths, so it would be a shame if AI CS6 is not.

    See the image attached for some content. Thanks in advance for any help!

    Screen-Shot.jpg

    Select your tracing and go to the Image Trace > Expand

    You may also then dissociate

  • Help with the line on the image final after using the magnetic lasso + layers

    I worked on an image that has some distortion of the lens in the.  I need to change the background and the subject separately because the colors are similar and there is simply too much work to do to try and spot heal the whole thing.  I cut out the subject with the lasso, magnetic, and created 2 separate the layers, a topic, a single background.  I then used the layers: adjustment layer: hue / saturation to correct the distortion.  When I did, I flattened the image.  Now I have a gray line on my final image where the lasso tool had cut the image apart.  I have no idea why it's there or how to get rid of.  It is very thin and probably not noticeable on smaller images, but I am determined to blow this up BIG picture where every mistake will be visible.  Any suggestions on how to avoid this line in the first place?  I don't think that I can remove it without going by one pixel.  Thank you!

    A better way to make your adjustments is to simply use the same mask and avoid creating separate layers:

    Here's the original:

    1. Select the "subject."
    2. Add a Hue/Saturation layer, which will be automatically hidden from the subject.
    3. Adjust the H/S in function.
    4. Duplicate this layer H/S.
    5. Select the mask of the H/S duplicate layer and press Ctrl + I, which will reverse the colors of mask (which means that the area of "background" will be affected).
    6. Adjust this new H/W layer in function.
    7. Your layers will look like this:

    The final image:

    No no cutting, no copy, etc. - the mask and its reversal will give a perfect edge.

    Ken

  • Conversion of the white areas of the image transparent

    Hello

    I wonder how to convert transparent in all the white areas of the following image:

    john-is-40-black-and-white.png

    Essentially, I just created a rectangle black and white text and a star shape. I wish that all areas that are white to be transparent (including black areas under white) so that when I save the artboard in png format areas that are white color will be transparent.

    Someone would be able to help me achieve this in Illustrator CS5?

    Thank you

    Nick

    A simple example of piercing group:

    1. draw a black filled circle
    2. draw a small white circle filled, centered on top of the black circle
    3. Select the two and group
    4. in the transparency Panel, select the sharp group
    5. direct select the white circle with the direct Selection (white arrow) tool
    6. in the transparency Panel, set its opacity to 0%
    7. file > save for Web: choose PNG as the file format and select the transparency option

    Depending on the type of objects you use, there are faster ways like using Pathfinder commands or transparent traces. You can see the as files using these keywords in Illustrator.

  • Invert the Pixels of the Image

    Hello

    I have a vi that calculated centroid and diameter, and the algorithm behind it works on intensity levels. My current work is on cards, so I need to reverse my pixels of images (see attachment file). He NEITHER has a built in reserved vi which (except invert IMAQ)?

    Thank you

    It works very well.  You don't see the results.  You load a new image in the next iteration until it had time to update the display.  The new image replaces the previous reverse image.

    Try the following solutions:

    Add a delay to your loop.  The two views shows the current version of the image (reversed).

    Switch the right-click on the snapshot on both screens.  This preserves the image in the State wherever it was when you posted it.  Very useful when you keep reusing the same image for processing.

    You can also use probes, which should use the snapshot method.

    Bruce

Maybe you are looking for