<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get image dimension width height in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095315#M1615848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know any function module or class method for this - though it may exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I just found out, JPEG structure is (in most cases) pretty simple. The JPEG files contains some identifiers starting a defined structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put the uploaded JPEG into an XSTRING field, search for start-of-frame 0 identifier followed by lenght and data precision constant 'FFC0001108'. This constant is followed by two unsigned integers for height and width. If you found this offset, assign xstring&lt;EM&gt;offset(2) to shortint height variable, add 2 to offset and assign xstring&lt;/EM&gt;offset(2) to shortint width variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As we do not have 2-byte unsigned integers we will move the first byte to an INT1 variable Hbyte, second byte to INT1 variable Lbyte and get the result as Hbyte * 256 + Lbyte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found information on [Getting JPG dimensions with AS3 without loading the entire file|http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/] in non-ABAP language. Give it a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 09 Jul 2011 13:07:00 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2011-07-09T13:07:00Z</dc:date>
    <item>
      <title>Get image dimension width height</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095314#M1615847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am uploading a JPG image file in GUI and I need to validate its dimension. Is there any function module that I can use to get the width and height?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jul 2011 21:21:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095314#M1615847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-08T21:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get image dimension width height</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095315#M1615848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Felipe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know any function module or class method for this - though it may exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I just found out, JPEG structure is (in most cases) pretty simple. The JPEG files contains some identifiers starting a defined structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put the uploaded JPEG into an XSTRING field, search for start-of-frame 0 identifier followed by lenght and data precision constant 'FFC0001108'. This constant is followed by two unsigned integers for height and width. If you found this offset, assign xstring&lt;EM&gt;offset(2) to shortint height variable, add 2 to offset and assign xstring&lt;/EM&gt;offset(2) to shortint width variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As we do not have 2-byte unsigned integers we will move the first byte to an INT1 variable Hbyte, second byte to INT1 variable Lbyte and get the result as Hbyte * 256 + Lbyte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found information on [Getting JPG dimensions with AS3 without loading the entire file|http://www.anttikupila.com/flash/getting-jpg-dimensions-with-as3-without-loading-the-entire-file/] in non-ABAP language. Give it a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 13:07:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095315#M1615848</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2011-07-09T13:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get image dimension width height</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095316#M1615849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think you can use IGS (depending on your SAP release). IMGCONV tool can be reached through CL_IGS_IMAGE_CONVERTER, where you can get attributes HEIGHT and WIDTH. To be tested.&lt;/P&gt;&lt;P&gt;More info: &lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/17/86c039c7811f11e10000000a114084/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/17/86c039c7811f11e10000000a114084/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Search SDN too.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Jul 2011 14:15:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095316#M1615849</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-07-09T14:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Get image dimension width height</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095317#M1615850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;solved, Thanks Clemens&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Felipe Grajales on Jul 11, 2011 4:41 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 14:40:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095317#M1615850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-11T14:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Get image dimension width height</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095318#M1615851</link>
      <description>&lt;P&gt;Check this code snippet. Not tested on all picture formats, but jp(e)g works well.&lt;BR /&gt;Under hood works the IGS, but this nice encapsulation does the job.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
  mimetype        TYPE string,
  xres            TYPE i,
  yres            TYPE i,
  xdpi            TYPE i,
  ydpi            TYPE i,
  bitdepth        TYPE i,
  image_processor TYPE REF TO cl_fxs_image_processor.

image_processor = NEW #( ).

DATA(handle) = image_processor-&amp;gt;add_image_from_url( iv_url = '&amp;lt;real url pointing to an image&amp;gt;').

image_processor-&amp;gt;get_info( EXPORTING iv_handle   = handle
                           IMPORTING ev_mimetype = mimetype
                                     ev_xres     = xres
                                     ev_yres     = yres
                                     ev_xdpi     = xdpi
                                     ev_ydpi     = ydpi
                                     ev_bitdepth = bitdepth ).
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Mar 2021 16:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-image-dimension-width-height/m-p/8095318#M1615851</guid>
      <dc:creator>RieSe</dc:creator>
      <dc:date>2021-03-12T16:03:05Z</dc:date>
    </item>
  </channel>
</rss>

