<?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: Height and width in cl_fxs_image_processor in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512624#M2004143</link>
    <description>&lt;P&gt;external tool like Image Magick  &lt;A href="https://imagemagick.org/index.php" target="test_blank"&gt;https://imagemagick.org/index.php&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 06:22:57 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2021-10-20T06:22:57Z</dc:date>
    <item>
      <title>Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512619#M2004138</link>
      <description>&lt;P&gt;hey all&lt;/P&gt;
  &lt;P&gt;I use class cl_fxs_image_processor to resize some png-files in my system. But I've a problem with pictures in portrait mode.&lt;/P&gt;
  &lt;P&gt;Example:&lt;/P&gt;
  &lt;P&gt;Picture has a height of 4624px and a width of 2084px&lt;/P&gt;
  &lt;P&gt;But cl_fxs_image_processor=&amp;gt;get_info states xres = 4624 and yres = 2048 which isn't correct... as a consequence the resized picture is mailed rotated...&lt;/P&gt;
  &lt;P&gt;How can I get the right information of my XSTRING-Picture?&lt;/P&gt;
  &lt;P&gt;Or can I get EXIF-information out of the xstring to change X and y myself?&lt;/P&gt;
  &lt;P&gt;Any other hints?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;importing if_original type xstringval
returning rf_small type xtringval  

METHOD resize4mail.

    TRY.
        DATA(lo_image) = NEW cl_fxs_image_processor( ).
        DATA(lf_handle) = lo_image-&amp;gt;add_image( if_original ).

        lo_image-&amp;gt;get_info(
          EXPORTING
            iv_handle   = lf_handle
          IMPORTING
            ev_xres     = DATA(lf_xres)
            ev_yres     = DATA(lf_yres) ).

        "Neue Höhe berechnen... Verhältnis beibehalten
        DATA(lf_ratio) = lf_xres / lf_yres.
        DATA(lf_xres_new) = cc_xres_mail. "1024
        IF lf_xres_new &amp;gt;= lf_xres.
          rf_small = if_original.
          lo_image-&amp;gt;discard_image( lf_handle ).
          FREE lo_image.
          RETURN.
        ENDIF.
        DATA(lf_yres_new) = lf_xres_new / lf_ratio.

        lo_image-&amp;gt;resize(
          EXPORTING
            iv_handle = lf_handle
            iv_xres   = lf_xres_new
            iv_yres   = lf_yres_new ).

        rf_small = lo_image-&amp;gt;get_image( lf_handle ).

        lo_image-&amp;gt;discard_image( lf_handle ).
        FREE lo_image.

      CATCH cx_root.
        ASSERT 1 = 2.
    ENDTRY.
  ENDMETHOD.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 13:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512619#M2004138</guid>
      <dc:creator>DaniEmmenegger</dc:creator>
      <dc:date>2021-10-11T13:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512620#M2004139</link>
      <description>&lt;P&gt;No problem for me with portrait image, I get correctly x=529, y=849.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 13:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512620#M2004139</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-10-11T13:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512621#M2004140</link>
      <description>&lt;P&gt;yes i know... very strange.&lt;/P&gt;&lt;P&gt;The pics are taken by mobile phone and uploaded via an Fiori App. If I display the same picture also on an app, it isn't rotated. If I send the mail without resizing it, it isn't rotated... just if I call method get_info the values are switched and the picture is rotated after resizing it.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 14:05:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512621#M2004140</guid>
      <dc:creator>DaniEmmenegger</dc:creator>
      <dc:date>2021-10-11T14:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512622#M2004141</link>
      <description>&lt;P&gt;I have used it here, and no problem with all image. Code is little bit long &amp;amp; protected to publish it&lt;/P&gt;&lt;P&gt;but looks like your&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  METHOD convertit_taille_image.
    DATA(lv_nouvelle_taille_x) = get_taille_x_image( iv_image_id ) / iv_facteur_conversion.
    DATA(lv_nouvelle_taille_y) = get_taille_y_image( iv_image_id ) / iv_facteur_conversion.
    TRY.
        go_image_processor-&amp;gt;resize( iv_handle = iv_image_id
                                    iv_xres   = CONV i( lv_nouvelle_taille_x )
                                    iv_yres   = CONV i( lv_nouvelle_taille_y ) ).
      CATCH cx_sy_range_out_of_bounds .
        rv_image_data = go_image_processor-&amp;gt;get_image(  iv_image_id ).
    ENDTRY.
    rv_image_data = go_image_processor-&amp;gt;get_image(  iv_image_id ).
  ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with french comment, it works better &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 14:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512622#M2004141</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-10-11T14:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512623#M2004142</link>
      <description>&lt;P&gt;Unfortunately, the issue is known. The class is obsolete.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Hello Daniel,
regarding the problem of the lost orientiation of the image: this problem happens when using CL_FXS_IMAGE_PROCESSOR-&amp;gt;ADD_IMAGE() as well as with method -&amp;gt;RESIZE().

1. Method ADD_IMAGE()
With the call of method ADD_IMAGE() the metadata (width, height, color depth) are read from the JPEG marker'SOF' in the image file. The orientation of the image is not part of that JPEG marker. The orientation of the image are part of the EXIF meta data but these are ignored and get lost when an image is 'added' with method ADD_IMAGE()

2. Method RESIZE()
Resizing is based on the IGS(Internet Graphics Service). This uses internally the libjpeg library which itself doesn't support EXIF data in the version which is used by IGS. So during scaling the EXIF data are removed completely from the image.
Unfortunately IGS is also a very old component and will not be updated.
Regarding the support of package S_XSLFO: the features of packages S_XSLFO* and S_XSL_FO* was never released for external development. Both packages were part of a bigger project of which the development was stopped many years ago. Unfortunately this was not communicated well and therefore we released SAP note 
&lt;A href="https://launchpad.support.sap.com/#/notes/3073421" target="test_blank"&gt;https://launchpad.support.sap.com/#/notes/3073421&lt;/A&gt;
to describe the current support for the different OOXML packages. For compatibility reasons we were also not able to fully rearrange the different packages to S_OOXML_DEPRECATED because such changes would lead to warnings/errors in our QA systems because the affected releases were shipped already. So as of SAP_BASIS release 753 the package S_XSLFO is also part of S_OOXML_DEPRECATED.

Best regards,
SAP Development Support&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And theres no supported api to resize pictures:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Hello Daniel, 
unfortunately we are not aware of any supported ABAP API for resizing images or other image processing functionality. So we are sorry but we cannot give you a solution. 

Best regards, 
SAP Development Support &lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So... if someone has an idea... I would be happy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 06:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512623#M2004142</guid>
      <dc:creator>DaniEmmenegger</dc:creator>
      <dc:date>2021-10-20T06:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512624#M2004143</link>
      <description>&lt;P&gt;external tool like Image Magick  &lt;A href="https://imagemagick.org/index.php" target="test_blank"&gt;https://imagemagick.org/index.php&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 06:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512624#M2004143</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-10-20T06:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Height and width in cl_fxs_image_processor</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512625#M2004144</link>
      <description>&lt;P&gt;I believe your only option is to work around the problem.&lt;/P&gt;&lt;P&gt;Girods suggestion (Image Magick) only works if you have a on-premise sap system.&lt;/P&gt;&lt;P&gt;We solved this problem by resizing the image in our SAP UI5 Application with canvas.&lt;/P&gt;&lt;P&gt;Depending on your use-case you might want to check if you can resize the image with css in your email. &lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 12:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/height-and-width-in-cl-fxs-image-processor/m-p/12512625#M2004144</guid>
      <dc:creator>smn-kr</dc:creator>
      <dc:date>2022-02-10T12:09:04Z</dc:date>
    </item>
  </channel>
</rss>

