Height and width of metadata is not for png and gif format

Hello

the following code works as expected for most types of file

var file = app.document.getSelection("psd, jpg, jpeg, png, gif");
alert(file[0].core.quickMetadata.height);
alert(file[0].core.quickMetadata.width);

But he always returns 0 for all png and gif files.

How can I get the value of width and height for files png and gif with bridge scripting (without opening the files in Photoshop)

Concerning

It seems to work.

File.prototype.readByte = function() {
   return this.read(1).charCodeAt(0);
};
File.prototype.readShort = function(ET) {
   var self = this;
   var b1 = this.readByte();
   var b2 = this.readByte();
   if(ET == "LE"){
      return (b2 << 8) + b1;
   }else{
      return (b1 << 8) + b2;
   }
};
File.prototype.readLong = function(ET) {
   var self = this;
   var s1 = self.readShort(ET);
   var s2 = self.readShort(ET);
   if(ET == "LE"){
      return (s2 << 16) + s1;
   }else{
      return (s1 << 16) + s2;
   }
};
var folder = Folder.selectDialog( "Please select input folder");
var GIFS = folder.getFiles("*.gif");
var Info = [];
for (var a in GIFS){
var file = File(GIFS[a]);
file.encoding = 'BINARY';
file.open('r');
file.seek(6,0);
var Width = file.readShort("LE");
var Height = file.readShort("LE");
file.close();
Info.push([[decodeURI(file.name)],[Width],[Height]]);
}
for(var z in Info){
$.writeln(Info[z].toString());
}

Tags: Bridge

Similar Questions

  • Illustrator constrain proportions do not impose no height and uniform width

    I noticed this problem a few times now the last few months, but today it was annoying me more than usual - so time to see if anyone else has had or knows a solution.

    I press "M" or "L" and shift-click and drag to create a square or circle (or any other simple shape) with height and width.  I see the following in the toolbar:

    for the fine search.  However, I would like to make the shape a little bit bigger.

    1. I go to the toolbar as shown above and make sure that the height and width link is set to constrain the proportions and then I click on one of the arrows and it increases both height and width EQUAL , but where he jumps usually up to one millimeter alone, instead, it climbs 11.001 - it seems to add or moins.001 of a millimeter of height and width.

    2. starting at the image above, I click on the arrow pointing upwards on the width and I get the following text:

    3. If I click down arrow 3 times the height and width down to 11 mm, 10 mm, then 9,999 mm.  If I wear by clicking on the bottom, it engages 8.999, 7.999 etc.. If I type, say "10" and then press ENTER, I get the following:

    4. well, this is not true - the height and width must be the same.  So I deselect the button of "constrain proportions" and together both to '10', then turn it on constrain proportions again and click up arrow again and I get:

    This problem happened randomly for a while now.  This example above I tested on a new document.  When this problem occurred immediately, I created another new document and more or less the same thing happened.

    This happens to you at all?  or just me?  and everyone has found a solution to this problem?  I know it's only very slightly inaccurate but Illustrator is a professional software and mistakes like that just shouldn't happen.  What I have to reboot every time or is there something simple, I'm missing here?  Sometimes, this feature works without a problem, so I'm puzzled as to what it could be.

    OK, just reset preferences and I can't reproduce the problem at the moment.  I hope this makes it set for now.

  • How keep the anchor in the Middle during the change of height and width for extendscript model?

    When I try to change my composition height and width using extendScript, it works but with anchor point at the upper left corner. How to maintain it in the Center?

    My code:

    COMP. Width = 4000;

    COMP. Height = 4000;

    result:

    result.jpg

    expected:

    expected.jpg

    Thank you

    OK, here is therefore the function for resizing of the model code. I tested several times with anchor points are offset on layers and centered, even with layers that are not yet within the limits of the Model Viewer. I'm sure there will be some users who eventually find something that will break it, but for now it seems to work perfectly.

    app.beginUndoGroup("CompResize");
      var myComp = app.project.activeItem;
      resizeComp(myComp, 500, 500);
    app.endUndoGroup();
    /* TESTING ABOVE */
    
    function resizeComp(compObj, newWidth, newHeight){
      if(typeof newWidth == "number" && typeof newHeight == "number"){
      if(compObj instanceof CompItem){
      var locData, allLayers, allLayersLen, curLayer, clAP, clPos, xShift, yShift, oldCW, oldCH, clH, clW, xOff, yOff;
      pData = new Array();
      cWidth = newWidth;
      cHeight = newHeight;
      allLayers = compObj.layers;
      allLayersLen = allLayers.length;
      oldCW = compObj.width;
      oldCH = compObj.height;
      compObj.width = cWidth;
      compObj.height = cHeight;
      for(var i=1; i<=allLayersLen; i++){
      curLayer = allLayers[i];
      clW = curLayer.width;
      clH = curLayer.height;
      clPos = curLayer.transform.position.value;
      clAP = curLayer.transform.anchorPoint.value;
      xShift = (oldCW - cWidth)/2;
      yShift = (oldCH - cHeight)/2;
      curLayer.transform.position.setValue([clPos[0] - xShift, clPos[1] - yShift]);
      }
      }else{
      alert("Invalid argument(1):\nComp Object required.");
      }
      }else{
      alert("Invalid argument(2/3):\nInteger required for Width and Height.");
      }
    }
    
  • Animate FancyBox iframe in Edge - do not show the correct height and width

    Hi all

    Can someone please provide advice or a solution to this problem.

    I tried to use the edge Fancybox.js animate to call an iframe (as a pop up album).

    However when I try this it does not show the correct height and width properties - even though I am their definition.

    When I test this on my hard drive it works fine in Chrome and Firefox. But when tried on line on a test server I get a slim pop up that has not properly set the height.

    Would be - because the iframe is pre-configured before composition/html page first affecting the size?

    Help, please

    CODE USED:

    $. fancybox.open)

    {

    type: "iframe"

    autoScale: 'false. '

    height: '600'.

    Width: '600',

    HREF: 'llink.htm site publication. "

    }, {

    padding: 0

    });

    Other references: http://businessanywhere.biz/blog/2013/03/adding-a-lightbox-to-edge-animate/

    See you soon,.

    Jason

    HI koyissa,

    Thank you for your response to this.

    I worked on what was the problem - my external publication that was created to animate dashboard was centered horizontally and vertically.

    He created the problem. When I took this out of the box of fancy worked well.

    See you soon,.

    Jason

  • I want to develop an application Live TV for BlackBerry PlayBook. Please guide where can I find the specifications such as width, height, and icon sizes and design factors etc.

    I want to develop an application Live TV for BlackBerry PlayBook. Please guide where can I find the specifications such as width, height, and icon sizes and design factors etc.

    Guideleines of the user and the specifications on the sizes of icons etc to BlackBerry PlayBook OS Applications

    OK, I downloaed the pdf below for UI guiderlines

    UI_Guidelines_BlackBerry_PlayBook_Tablet_2_1.PDF

    Ok

  • I need a file to an exact width and height and it must be in png format, because it allows to translucency. My graphics are only the top of the page and when I export only the graph is not exported the entire file. How can I get the entire file to ex

    I need a file to an exact width and height and it must be in png format, because it allows to translucency. My graphics are only the top of the page and when I export only the graph is not exported the entire file. How can I get the entire file of export including blank parts?

    in the export dialog box, you have chcked 'use of work plans? ''

  • Minimum height and width does not work in the responsive project

    I'm working on a responsive project in Captivate 9, breakpoint Office, for one of the items minimum height 50px and Minimum width to 50px.

    In points out of office and Tablet, she gets no smaller than 50px. However, breaking Mobile, point it turns into 32px Min-Height and Min-Width 4.0px.

    The 32px Min-Height and Min-Width 4.0px take a coral color in the breakpoint Mobile.

    Why don't the 50px which was update to stop Office remain the same on all breakpoints?

    What is the purpose? A 50 x 50 pixel png? I just create a project that is sensitive with a png of 200 x 200, placed in the desktop view and then set the size of the object and the height to 50 pixels. When I pass between breakpoints, the size remains the same. The size and position properties are all a light purple color on each breakpoint, which I guess means that these attributes are inherited from the Office discovers.

    If the boxes under "Height" and "Width" have transformed a coral-colored, I guess that means that these attributes have been changed for this breakpoint.

    And you obviously already know. I guess that I'm just trying to say that he expected to run, as it does for me!

    You are able to adjust these modified figures go back to your desired size? The same thing happens if you create, say, a dynamic square object in the view of the Office? Have you tried right clicking on the object in the desktop view and selecting "Apply position properties from all points of view"?

  • Necessary to set the height and width of the image of itemRenderer for virtualization of the list

    Hello

    By default the spark list supports virtualization (which is cool), but I came across a problem with the list create all of the itemrenderers even when useVirtualization is set to true. After some debugging and the samples I made, it became clear he did not define the width and height on the image within the itemRenderer.

    Is this a bug or an expected behavior?

    
    
    
    
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" 
                        xmlns:s="library://ns.adobe.com/flex/spark" 
                        xmlns:mx="library://ns.adobe.com/flex/mx" 
                        autoDrawBackground="true" useHandCursor="true" mouseChildren="false" creationComplete="itemrenderer1_creationCompleteHandler(event)">
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
    
                   protected function itemrenderer1_creationCompleteHandler(event:FlexEvent):void
                   {
                        trace("created " + this.data);
                   }
    
              ]]>
         </fx:Script>
         
         <!-- Without setting a specific height it will not work in virtualization! -->
         
         <mx:Image height="187" width="280" source="{data}" />
         
    </s:ItemRenderer>
    
    

    https://bugs.Adobe.com/jira/browse/SDK-23621

  • Request for information on the height and width of display devices

    I want to know the width of screen blackberry devices and the height from 4.5 os. I want the list of devices with their height and width of the screen. Where can I find them?

    Concerning

    Rakesh Shankar.P

    You can check this one also, more details

    http://docs.BlackBerry.com/en/developers/deliverables/11886/BP_controlling_resource_size_619260_11.j...

  • Get the height and width of the object of a threshold

    Hey guys,.

    I am currently working on the extraction of the human sillouhette. Currently, I am trying to retrieve the height and the width of a human sillhouhette for further analysis. Are there any screws for this? Or if any of you can recommend a method? I really need help. The 2 images below should illustrate what I'm talking about. Note that I have several images (various) to analyze a video.... Help is really appreciated. Thank you.

    Concerning

    This task could be run with IMAQ particle analysis Report.vi.

    Please note that this VI is installed with the Vision Development Module.

  • Get the height and width of an image

    I have therefore some images in my program that I'm loading. These images are much longer than the size of the screen. So I put in a ScrollView. My question is how can I get the height and width of an image. The image.width and image.height doesn't return the correct values.

    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    

    and my code scrollview is

    //add to the scrollView
    var scroller:ScrollPane = new ScrollPane();
    scroller.width = 650;
    scroller.height = 505;
    scroller.y = 0;
    scroller.addScrollContent(addImage());
    addChild(scroller);
    

    Thanks in advance!

    Hey shethab,

    in order to retrieve the height and width of your image, you must use use the an event listener on your image and check for the Event.COMPLETE event. What is happening because the image you upload is not built, it takes time to load into your application using the setImage() method. and when you check the width height after the setImage method, the image was not loaded and has no height and width to this second. If you use the event listener, you can retrieve the height and width as it was finally loaded.

    Try the following code:

    import flash.events.Event;
    
    //add the image
    private function addImage():Container {
        var sp1:Container = new Container();
        sp1.sizeUnit = SizeUnit.PIXELS;
        sp1.debugColor = 0xFFFFFF;
        sp1.margins = Vector.([1,0,0,0]);
        sp1.align =ContainerAlign.NEAR;
        //sp1.setSize(650, 800);
    
        var myPattern:RegExp = / /g;
        var fileName:String = "./com/swiz/img1.png";
        var icon:Image = new Image();
        icon.setImage(File.applicationDirectory.resolvePath(fileName).url);
        icon.addEventListener(Event.COMPLETE, onImageLoaded);
        //icon.setPosition(0,0);
        //icon.setSize(320,800);
        sp1.addChild(icon);
        sp1.setSize(650, icon.height);
    
        return sp1;
    }
    
    private function onImageLoaded(e:Event):void
    {
        trace("image height: " + e.target.height + " image width: " + e.target.width);
    }
    

    hope that somethings brightened. Good luck!

  • What is the best way to resize an image, but keep the height and width of the same original size or format?

    What is the best way to resize an image, but keep the height and width of the same original size or format?

    I tried to use the function of the size of the Image, but when I changed the size of the image, the width has not changed with it.

    Thanks for the tips!

    Hi Landon.Luu,

    You want to keep the relationship between the width and height to be the same?

    Click the constraint between width and height to keep the ratio intact.

    Kind regards

    Claes

  • All webcam width/height and determine the connection type

    Hi, two quick questions:

    1. is there a way in ActionScript to determine what type of connection is used (e.g., P2P or FMS)?

    2. is there a way to set the width/height of the image of the webcam? I currently have to extend the WebcamPublisher class to access the instance of _camera and use the Camera.setMode () method, but it seems that that has no effect whatsoever.

    Thanks in advance,

    Michiel

    PS: I am aware of the captureWidthHeightFactor method, but I really do not like this approach, as it is not clear what dimensions are used for the video. I would like to determine the dimensions of myself, as when you use the Camera.setMode () method.

    For your share of width and height, you can use APIs of resolutionFactor in webcamPublisher as captureWidthHeight that API is deprecated. Height and the default width is multiplied.

    And again, if you want to set your own native height/width, since you already are subclassing WebcamPublisher, subclass just the createMyStream function and add your native width and height. See this function in the source code 9 WebcamPublisher player provided.

    One thing I forgot to mention in the last post, you have P2P with player 10 and you must use the Player 10 SWC for any verification of P2P. Player 9 will always be FMS.

    I hope this helps.

    Thank you

    Hironmay Basu

  • How can I control the monitor photo height and width with XP?

    Having 24 ' ASUS monitor.  There are no controls for the height and width of the image.  Operating system is Windows XP.  How can I change picture height and width?

    Hello

    You can try to change the resolution of the monitor screen and check if that helps.

    To change your screen resolution

    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/display_change_screen_resolution.mspx?mfr=true

    If you want to change the position and other options that are provided as an option on the screen of the monitor you can see the manual provided by the manufacturer or contact the manufacturer for more information about the options provided in the monitor to change the position of the screen.

  • Height and width of display

    How do you get the height and width of the screen?

    IE Java Display.getWidth)

    For all those who need to have it here is how I did it

       screen_context_t m_screen_cxt;
        int count = 0, size[2];
        screen_display_t *displays;
    
        screen_create_context(&m_screen_cxt, SCREEN_APPLICATION_CONTEXT);
        screen_get_context_property_iv(m_screen_cxt, SCREEN_PROPERTY_DISPLAY_COUNT, &count);
    
        displays = (screen_display_t*)calloc(count, sizeof(screen_display_t));
    
        screen_get_context_property_pv(m_screen_cxt, SCREEN_PROPERTY_DISPLAYS, (void **)displays);
        screen_get_display_property_iv(displays[0], SCREEN_PROPERTY_SIZE, size);
    
        free(displays);
    

    size [0] contains the width of the screen, size [1] contains the screen height

Maybe you are looking for

  • HP Envy 17-k206na computer laptop: HP Envy 17 k206na

    After that multiple crashes and locked screens using Windows 10, I am now back to Windows 7 (64-bit). Now, I have no WiFi and have tried to install many similar topics messages pilots here but still have no WiFi. I tried the page official drivers (be

  • Laptop stops randomly and gets stuck on the saving settings

    Basically, we have some laptops 10 + this will stop randomly and get stuck on the "saving settings screens. Here are the different models of toshiba R500-R600 M10 M9 M5 We changed versions of bios etc, reimagee them, even used an image of windows xp

  • Windows Update does not not IE8/XP error 0X800A0046

    After cleaning my computer from various virus infections and to try a bunch of bugs Windows update no longer works.  I get error 0x800A0046 and have tried every solution I can find on the net including http://support.microsoft.com/kb/883821 all to no

  • How to delete a backup image of the computer?

    Last week I had to format my hard drive of the PC (I won't go into details, but a certain SQL Server 2008 SP1 was the culprit). I reinstalled Windows Vista Ultimate 64-bit and spent 5 days to install my apps and all the updates of windows (SQL Server

  • Kobo ereader installation problems

    I come from the Kobo ereader out of the box, plugged the USB cable, can not go further because the message "USB device not recognized by Windows. Can anyone help please.