CS4: Fit Image Problem

Recently had a very bizarre issue that just happened. Not sure why, but it won't go away.
I use the Fit Image script quite a bit. For sizing images that will end up on the blog, batching out files for proofs, etc. I have it written into many of my actions.
Up until a few days ago, if you opened any action that I've recorded and expanded out the Fit Image step, you would see the dimensions (in pixels) that were recorded. Then, I started getting an error message for any action that used Fit Image. The error message was "Javascript code was missing".
I checked my scripts folder and the Fit Image script is there. Nothing has changed. I even used Time Machine to go back a few weeks and see if anything had been deleted. Nothing.
I tried to write a new action using Fit Image and now, instead of the expanded view showing the size in pixels, it's showing in inches! When I manually use Fit Image, the dialog box comes up with pixels ONLY, so why is it that the recorded step is shown in inches?
I've gone so far as to uninstall CS4 and reinstall it. The first thing I did was record an action and I'm getting the same results. Why would this just change and does this mean I have to re-record all my actions that use Fit Image?
Any ideas or insight?

The problem come down to the fact the the way scripts are recorded in actions the full path of the script is recorded. If you un-install CS3 its script directory will be deleted so the script is gone CS4 script is in a different directory.
CS2 and prior recording of the plug-in fit image were recorded as step Fit Image not as a script path step.  These actions should still work for when Photoshop starts up the CS4 Fit Image scripts register as the plug-in Automate>Fit Image.  When these action  are played and the plug-in step Fit Image get played it is looking for the registered Fit Image Plug-in Photoshop should run the CS4 Fit Image Script.
The bug in Fit Image is very minor.  One day I used fit image on a image that was 1080 x 1080 and fit image was set to 1200 x 1200 the resulting image turned out to be 1201 x 1200 one side was one pixel off there were 1200 extra pixels.
Reading the CS3 Fit Image Script I saw this:
     docRatio = docWidth / docHeight; // decimal ratio of original width/height
     // NOTE - ccox - 17 Aug 2004 - I added the rounding by 0.5
     // this should solve reported cases of fit image being off by 1 (always under)
     // NOTE - elr - 3 May 2006 - keep original aspect ratio
     newWidth = width;
     newHeight = ((1.0 * width) / docRatio) + 0.5; // decimal calc
     newHeight = 1 * newHeight; // make integer
     if (newHeight > height) {
          newWidth = 0.5 + docRatio * height; // decimal calc
          newWidth = 1 * newWidth; // make integer
          newHeight = height;
Someone fixed fit image not to be one pixel under.  I thought this fix most likely cause my one over problem so I stuck in some alerts to see the numbers. Looked like the multiply by one to round did not round and I thought the .5 value perhaps would work better if it were .4.  So I changed to code to
     docRatio = docWidth / docHeight; // decimal ratio of original width/height
     // NOTE - ccox - 17 Aug 2004 - I added the rounding by 0.5
     // this should solve reported cases of fit image being off by 1 (always under)
     // rounding by .5 seem to make some sides 1 Px large change to .4 and used math round to round JJMack
     // NOTE - elr - 3 May 2006 - keep original aspect ratio
     newWidth = width;
     newHeight = ((1.0 * width) / docRatio) + 0.4; // decimal calc
     newHeight = Math.round(newHeight); // make integer
     if (newHeight > height) {
          newWidth = 0.4 + docRatio * height; // decimal calc
          newWidth = Math.round(newWidth); // make integer
          newHeight = height;
The name of my script file is "My Fit Image.jsx" I renamed Adobe file to "Fit Image.jsx.Adobe" My script is in My Photoshop Script tree which I linked to Photoshop's Presets\Script\ by placing a shortcut to my tree into into Photoshop's Script directory. "My Fit Image.jsx" registers itself as Automate>Fit Image...
$$$/JavaScripts/FitImage/Name=Fit Image...
$$$/JavaScripts/FitImage/About=Fit Image   Version 10.0   By Quality Process^r^rCopyright 2007 Adobe Systems Incorporated. All rights reserved.^r^rResizes a document constrained by the given bounds.^r^rJohn J. McAssey Modified Version^rFixed the one side one pixel to long problem^rand changed the interpolation Method used^rUpsizing will use Bicubic Smoother^rDownsizing Bicubic Sharper^rInstead of just using Bicubic for all resizing like Adobe did.
automate

Similar Messages

  • Fit Image CS4: Error: Unable to create Window - OS error [1400]:210

    Hi there,
    I'm running Vista Ultimate 64 bit Photoshop CS4 Extended and have come across a problem with the Automate/Fit Image script. I have read the other posts here concerning a bug in the script, but I'm not even getting to the stage of the script giving me any options to run - I just get the following in a Script Alert message box: Fit Image CS4: Error: Unable to create Window - OS error [1400]:210
    I can see that the script is in the Presets/Scripts directory OK. Anyone with any ideas please?

    Thanks for that reply. I tried this again and it's working now. The only thing I can think of is that I have closed and opened Photoshop a number of times since having the problem and that may have fixed it.
    I find that if I am doing a lot of work in quick mask mode on large images with the pen tool, after a while, Photoshop starts to develop a very significant lag time, taking a number of seconds to draw the next point or respond to the tool (I'm on Vista 64 bit with 12 GBs of RAM, so it shouldn't be RAM, GeForce 8800 GTS video card 640MB dedicated video memory). I find that I have to frequently close Photoshop to get the tool response time back to normal. Perhaps the inability to draw a dialog box was somehow linked with this kind of problem....

  • CS4 Bridge - Image and Contact Sheet Problems (Windoze)

    Problem #1: Out of shear chance, the first directory that I picked on that contains press images, resulted in Bridge not displaying thumbnails, or even being able to work with the image, because Bridge declares that the JPEG file is not a JPEG image. But, here is the kicker, when creating the thumbnails, it does briefly display a thumbnail before replacing it with the JPEG icon. There is nothing wrong with the images as Photoshop CS4 has no problem working with the same images. Double-clicking on the JPEG icon in Bridge results is it calling Photoshop to display the image. Lastly the images were created with Photoshop CS3 on a MAC, as indicated in the EXIF data. I haven't tracked down a pattern yet, as I just installed the software last night. Even so, there is no way that Bridge should have trouble reading CS3 produced JPEG images, but it does.
    Problem #2: With the old contact sheet method, one could tell the plugin to include all sub-directories. I can't find a way to get Bridge to do the same thing. If it is there, it certainly is not user friendly. There was nothing online, or in the manual, about how to do that. While I like the idea of producing a PDF of the contact sheets, getting there is not so simple. I'm new to Bridge, having never having the need to use it prior to this release.
    Any help with these two problems will be appreciated.

    If Bridge can not show the thumbnail, Output workspace can not generate the PDF or web gallery for this image. Because it use the Bridge's DOM to process those images.
    For the subfolder issue, you could use the Bridge's 'Show Items from sub-folder'. You could find this option from the directly path list at the tool bar, or from Menu View->Show Items from submenu.

  • Image problems in CS4

    Building pages fine for months in cs4. Images appear fine in
    preview and when uploaded. Today I can't get any image to preview
    or appear on site once uploaded. All previous pages w/ image still
    work fine. Have done all kind of experimenting to isolate the
    problem with no luck.
    Have recently started with cs4 after long absence since dw8.
    So I'm rusty. But this issue is making me nuts. Any suggestions out
    there on what simple thing I'm missing?
    thanx

    Are you asking us to guess what's up with your code or are
    you planning to
    provide a link.
    "Artworthy1212" <[email protected]> wrote in
    message
    news:gkqooo$f3b$[email protected]..
    > Building pages fine for months in cs4. Images appear
    fine in preview and
    > when
    > uploaded. Today I can't get any image to preview or
    appear on site once
    > uploaded. All previous pages w/ image still work fine.
    Have done all kind
    > of
    > experimenting to isolate the problem with no luck.
    >
    > Have recently started with cs4 after long absence since
    dw8. So I'm rusty.
    > But
    > this issue is making me nuts. Any suggestions out there
    on what simple
    > thing
    > I'm missing?
    >
    > thanx
    >

  • Fit image: always in centimeters instead of pixels?!

    Hi
    I'm desperatly looking for a solution to following problem: I want to batch resize images WITHOUT using the "image processor". So I recorded some "Fit Image" steps. In the past they actually got recorded with the unit "pixels" but with CS4 all pixel values get recorded as cm. I already set my ruler units to pixels but it doesn't matter. All actions get recorded in centimeters.
    This also happens with other actions.
    How can I record my actions in pixels?
    Thanks

    Thanks.
    Yes but it gets recorded like this (in centimeters):
    I'm recording either via the record button in the actions windows or by double clicking the entry you see above. It DOES work on my machine but as I often record actions for co-workers these actions won't correctly run on their installations.
    The problem with the Image Processor is that I can't control when the resizing is done. If I want to do some actions before resizing I can't do it with the IP.

  • CS4 fit content to frame default

    Hi all,
    Just a quicky, we have just upgraded to CS4 at work (late adopters I know!) and we have an issue with how ID CS4 fits the frame to content by default.  The problem with this is it is changing templates of material built in earlier versions of ID, for instance changing ellipse frames to squares, resizing all the frames to fit the content, etc. Is it possible to change this default behavior? All help is appreciated.
    Thanks

    Hi Guys,
    Thanks for the responses and I apologise for the delay in replying, it has been flat out here... Anyway I just want to confirm that the problem still exists. I am unsure how to explain it further although I will try
    When the frame fitting option is set to 'fit content to frame' Indesign applies a 'fit frame to content' which the operator must then undo. This especially occurs when placing content into ellipse or polygon frames. Indesign always applies a "fit the frame to content" (which obviously blows away the shape), the operator must then undo the 'fit frame to content' that CS4 automatically applies (crtl+z).
    Not sure it is related but we also suffer from a one minute delay upon opening Indesign and Acrobat, the windows "csrss.exe" process goes nuts and sits on nearly 100% cpu usage for about a minute before the program becomes usable. It seems related to the number of fonts installed on the system (around 2000) because if I remove all the fonts, delete the adobefnt files and reinstall the fonts the machine runs fine for a week or so before it bogs down again. I know that this file is not a virus, as we run symantec on our machines, also there is only one copy of this process in taskmanager. Also this has happened across multiple machines with varying hardware. Is there a hard limit on fonts?
    Thanks again
    Regards Chris

  • Photoshop CS4 file saving problem...

    Photoshop CS4 file saving problem: When no file name is specified, Photoshop saves file to the root directory of the drive instead of the current folder. It auto names the image with the name of the folder that was active. Can this be fixed?
    BTW: I was using "save for web"--not sure if it that matters.

    Bug reports should go in the main forum.
    And yes, SFW has it's own file code so that is a very important detail.

  • Can I do a "Fit Image" ala Photoshop in Illustrator

    I have need to be able to make different size and orientation images fit into a 1.25" x 2.15" area.
    I can do this easily in Photoshop with the "Fit Image" command. However, I haven't been able to figure out how to do this in Illy. I have created an action which can change the dimensions, but some are too tall or too wide for my confined area.
    Can anyone offer insight, please?
    Thanks!

    First no advertising on the forum you might want to edit your last post and remove all that crap.
    Now you your problem make an action, very simple.
    it goes like this start recording and the
    1. Select All
    2. Enter in the control panel width field the width you want
    3. Enter in the control panel the height you want stop recording
    Ok this might not be quite what you want because some are more vertical and some more horizontal and in the action click the  constrain proportion icon.
    so the you do two separate actions and you have to separate the vertical and the horizontal files into separate folders.
    You can use the bridge to select all the horizontal and Vertical artwork files. The bridge show a review of the art in Illy files.
    Now you can batch the two.
    It is a good feature request.
    The only other way would be to write a script with a true and false argument for width and height parameters.
    Then you would only need to run the script or have ti associated with a folder and drop the files in the folder.
    You can visit the scripting forum there maybe one that already exist.

  • Fit Image action stops on some jpgs

    I need to batch thousand of images w different file size dimensions & formats (.eps, .tif, .jpg) to have a print dimension 3"x2" @ 300 dpi (900x600 pixels). Fit Image seems to be the "perfect" feature for this task as long the image starting resolution is 300 dpi.  If the image starting resolution is 72 dpi I have to uncheck "resample image"  change document dimensions to 3"x2", check "resample image" & then change the resolution to 300 dpi to meet our print requirements.
    From Bridge CS5 I select the images that have resolution of 300 dpi> Tools> Photoshop> Batch> I select the action Fit Image.  The problem I'm having is w the jpgs. Sometimes I get the JPG options window. (See attached) which stops the batch to keep processing images until I select OK. I noticed this doesn't happen w every jpg. Is there any way to automate this task without getting any windows?
    I have learned a lot reading posts related to the Fit Image feature. I want to thank all the Photoshop gurus out there.
    PS.: I tried Image Processor... but I think Fit Image work better for my purposes. I'm using PS CS5

    Thank You c.pfaffenbichler for your quick response.
    I was searching for Fit Image in the forums & spent a good amount of time yesterday trying to find answer.  I guess I have to keep looking why I'm still getting the JPG options window.
    c.pfaffenbichler wrote:
    I think there have been previous threads about this, but you’d have to check them out to see if a workable solution was offered.
    Re-saving jpgs seems less than adviseable to me in any case.
    And I wonder why you find Fit Image more convenient than Image Processor in this case?
    In Bridge I select all the images that are 300 ppi including jpg, eps & tiff files. If the original file is a jpg  using Image Processor was Ok but when I'm processing eps & tif converting those files to jpg using Image Processor I noticed that the picture quality changed (blur)  & I have to sharpen the pictures.
    I would like to hear your opinion about Image Processor & why do you think is a better approach than Fit Image action

  • How to fit image inside canvas Container?

    Hi All,
    I want to fit an image inside a canvas.
    Making x and y to 0 of image is not working.
    My problem is I am rotating image at 90 and I want to save that image. If i save normally it is not taking rotation.
    So I am adding that image in a canvas and saving that canvas with rotated image.
    Somehow some portion of canvas still remains empty after adding image to it.
    Any idea how to perfectly fit image inside canvas?
    Or How to rotate image bitmap data with maintainig aspect ratio?
    Thank in advance

    Mx component don't handle rotation very well.  Spark Group should handle it
    better.
    You may need to set the y to the height of the rotated image (its original
    width).

  • CS3 Fit Image disabled?

    Photoshop CS3, with all updates.
    Menu File - Automate - Fit Image has suddenly become grayed out.
    Grayed out in menu, and batches fail to access it too.
    Actions fail with log entry:
    Error: The command "Fit Image" is not currently available. (-25920)
    Sometimes the error is command "Canvas Size" is not currently available (also in the batch).
    Batches earlier today using it worked OK, no problems until now.
    Have tried rebooting, still grayed out and does not work.
    Any clues to fix it are appreciated.

    Never mind, I think this was a different error. I made a new Action and it worked OK. I think it actually was a file open failure. The first Action had been recorded opening RAW, and I was trying to open TIF now, and it appears that the batch Override Action File Open stuff failed to know how to switch.

  • Fit Image & Sharpening

    In Photoshop CC
    Mac OSX
    When using the command 'fit Image' in an action, is there some sort of sharpening going on ? Bicubic, BicubicSharper, BicubicSmoother, none...

    I do no like your action at all put it in the trash.  I don't like the fact that you interpolating a single document 4 times.  It also look like you trying to backup in history to before one of the resizes but from what I see it misses and would just backup to before the save.  The Action might be hard to Batch perhaps the batch processor could override the save as steps but the names would be the same with a suffix.  A3 and A4 have a slightly different aspect ratio. I see nothing in you action to crop to either.  The Fit Image steps I see are for a Landscape or Portrait image the has a correct aspect ratio whatever you define as correct.   The fit image step make the larger side near A3 300dpi size and near A4 300dpi pixel size.  However I see no Image size step setting the DPI to 300dpi with resample not checked.  I could send you a plug=in script the you could use to do centered A3 and A4 aspect ratio crop that would handle both orientations.  Still there are other problems an action can't handle.
    The easiest want to handle this is with a script. A script that you do not need to write just download a use.  However because the A3 and A4 sizes have different aspect ratios that are also different the your camera images aspect ratio you may nee to do some cropping or decide on how you want to handle aspect ratio mismatches.
    Without any actions you could download the Image Processor Pro and process Landscape or Portrait images in a run.  If you want to mix landscapes and Portraits.  You would need to  download my crafting action package and use my plug-in script Aspect Ratio Selection in a couple of actions to do centered A3 and centered A4 crops of the selection set by the plug-in.
    Image Processor Pro type Dialog.
    A3
    420 x 297 mm
    16.5 x 11.7 in aspect ratio  1.414141414141414
    A4
    297 x 210 mm
    11.7 x 8.3 in aspect ratio 1.414285714285714
    300x16.5=4950  A3 @ 300dpi
    300x11.7=3510
    72x16.5=1188   A3 @ 72dpi
    72x11.7=842.4
    300x11.7=3510 A4 at 300dpi
    300x8.3=2490
    72X11.7=842.4  A4 @ 72dpi
    72x8.3=597.6
    Crafting Actions Package UPDATED Aug 14, 2012 Changed AspectRatioSelection Plug-in script added Path support.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    12 Scripts for actions
    Example
    Download

  • A script to increase the minimum canvas size? (Like Fit Image, but with just my canvas)

    For starters to be clear, I'm looking to manipulate canvas size. Not image size.
    I want to create a script to automatically increase the width and height of my canvas in Photoshop to a specific size when necessary. I only want this to happen if my canvas is less than that specified size. For example: Let's say my canvas size is 300x250. I want the canvas to be at LEAST 600x600. If I run my action it will increase the canvas size to 600x600 for me. If I run this same script on an image where the canvas size is already 700x700, it won't do anything at all to it because both the width and height are equal to or greater than my target size.
    It would also need to work with the height and width on an individual basis. If my image is 400x800, the action would increase my width from 400 to 600, but it would leave the height of 800 alone. So the final canvas size will end up being 600x800.
    It's kind of like the "Fit Image" option in Photoshop, but I only want to manipulate my canvas size, NOT my image size.

    It is possible.
    But if you hope that the dialog remembers the last settings that would require storing those values (which could be done with a txt-file at some pre-defined location), but it would make the Script a bit more complicated.
    // resize canvas in either direction if it is below a defined minimum;
    // 2011; use it at your own risk;
    #target photoshop
    if (app.documents.length > 0) {
    // dialog;
    var dlg = new Window("dialog", "increase width and height if under", [500,300,750,380]);
    // filter for checking if entry is numeric, thanks to xbytor;
    numberKeystrokeFilter = function() {
              if (this.text.match(/[^\-\.\d]/)) {
                        this.text = this.text.replace(/[^\d]/g, "")
              if (Number(this.text <= 0)) {this.text = 5};
              this.text = Math.round(Number(this.text));
    // fields for entry;
    dlg.hor = dlg.add("edittext", [14,15,88,35], "600", {multiline:false});
    dlg.hor.onChange = numberKeystrokeFilter;
    dlg.horText = dlg.add("statictext", [93,15,118,35], "px", {multiline:false});
    dlg.ver = dlg.add("edittext", [129,15,210,35], "600", {multiline:false});
    dlg.ver.onChange = numberKeystrokeFilter;
    dlg.verText = dlg.add("statictext", [215,15,240,35], "px", {multiline:false});
    dlg.hor.active = true;
    // ok- and cancel-button;
    dlg.buildBtn = dlg.add("button", [13,45,118,68], "OK", {name:"ok"});
    dlg.cancelBtn = dlg.add("button", [128,45,240,68], "Cancel", {name:"cancel"});
    // show dialog;
    dlg.center();
    // show dialog;
    var myReturn = dlg.show ();
    // proceed if ok-ed;
    if (myReturn == 1) {
    var myDocument = app.activeDocument;
    // set to pixels;
    var originalRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    // set the minimum values;
    var minWidth = Number(dlg.hor.text);
    var minHeight = Number(dlg.ver.text);
    // get current ones;
    var theWidth = myDocument.width;
    var theHeight = myDocument.height;
    // resize canvas;
    myDocument.resizeCanvas(Math.max(minWidth, theWidth), Math.max(minHeight, theHeight), AnchorPosition.MIDDLECENTER);
    // reset;
    app.preferences.rulerUnits = originalRulerUnits;

  • The trial version of Adobe photoshop 13 does not have the Crop And Straighten Photos option  under file and automate....... all it has is "Fit Image".......   would really like to have that feature.... is it something they eliminated?

    I am scanning in many old photos and there are several photos on one page.... I read about a feature that was suppose to be available under adobe photo shop elements 13 that would allow multiple cropping under the file, automate, Crop And Straighten Photos....... the only thing that displays on the version 13 that I have is "Fit Image"...... which doesn't help me......    have they removed this tool or do you have to crop and save one image at a time?    Thanks for your help?

    You want Image>Divide Scanned Photos

  • Image problem in V4.0

    Hi,
    Previously I had lots of problems with showing a BLOB image from a table
    in a report using the apex_util.get_blob_file_src function.
    Varad put me right on several ocassions: see the thread at
    Confusion with get_blob_file_src
    Eventually everything went well, and I got my images of a specific size on the screen.
    In the last month or two, the host database that I rent went up from version ten to version
    eleven, and the apex version changed too from 3.2.1 to some version of 4.
    I've only now discovered that the images don't display any more. I've re-read the thread
    mentioned above but can see no deviation from Varad's sterling advice. It still doesn't work,
    so my current guess is that something has changed when Apex went to its new version.
    Can anyone point me in the right direction regarding Image problems in version 4 ?
    I guess I'm not the first to experience such issues, and a checklist of things to try would
    be most welcome.
    I've done a View->Source on the page that doesn't work, and the issue with a missing value
    for the "d=" parameter on the apex_util.get_blob_file seems to have recurred:
    src="apex_util.get_blob_file?a=130&s=1718106956127950&p=13&d=&i=25615931827270369&p_pk1=5&p_pk2=&p_ck=947078FC54BB5126E7E0D19F8A24C416"
    Suggestions welcomed please; thankyou in advance.
    Mungo

    Hi Folks,
    I've found a solution to my "image" problem that caused this thread, hence the decent thing is to
    post it here.
    I read various other threads and stumbled across:
    PDF viewing with  apex_util.get_blob_file_src not working with 4.0
    PDF viewing with  apex_util.get_blob_file_src not working with 4.0 &# 4404695
    That thread mentioned the requirement for an "Automated Row FETCH" process as well as having
    an "Automated Row PROCESSING" process too.
    I had the latter, but didn't have the former, so throwing caution to the wind I tried adding a dummy
    Automated Row Fetch process and the damn thing worked!
    Haven't got a clue why on earth either of these are requirements on a page that is selecting data
    from the database - I don't understand where such processes are called in the big scheme of things.
    That's just me baiting some kind soul to spell out the fundamentals for this idiot... please?
    Happy to be corrected on any points.
    Regards until the next crisis...
    Mungo :-)
    P.S. How come there is no reasonable way to get the URL of a single post in a thread - I'd like to give
    reference to the single post that helped me, but all I seem to be able to get is the whole blooming thread.
    Suggestions?
    Edited by: MungoHenning on Sep 15, 2010 1:39 PM

Maybe you are looking for