Skip to Content
-1

Convert JPG to BMP, is it possible?

As the question said id need to do this with some jpg images, i'm lookinmg for info, reading other question but nothing is really clear. Please if anyone knows i'll by thankful all my life :c

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Oct 15 at 08:14 PM

    Do you need make the conversion using ABAP?

    Check the standart report GRAPHICS_IGS_IMGCONV_DEMO .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 15 at 09:40 PM

    Have worked on a similar requirement, But popped up the Save As window in within the frame with : cl_gui_frontend_services=>file_save_dialog, you could restrict the option with the parameter default with "BMP"


    download.png (25.0 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 15 at 10:28 PM

    Hi Naoto Amari

    You can use class CL_IGS_IMAGE_CONVERTER

    Here is one code example from Luca Grilli:

    DATA: blob TYPE w3mimetabtype,
    blob_size TYPE w3param-cont_len,
    blob_type TYPE w3param-cont_type .
    DATA:
    p_color_scheme TYPE char20 ,
    p_labels_groupid TYPE igs_label_tab,
    p_labels_category TYPE igs_label_tab ,
    p_data TYPE igs_data_tab,
    p_charttype TYPE char20,
    p_legend TYPE char20,
    l_igs_chart TYPE REF TO cl_igs_chart ,
    l_igs_chart_engine TYPE REF TO cl_igs_chart_engine,
    i_igs_image_converter TYPE REF TO cl_igs_image_converter,
    mime TYPE w3mimetabtype,
    html TYPE w3htmltabtype,
    html_line TYPE w3html,
    l_msg_text(72) TYPE c,
    l_url TYPE w3url,
    l_content_length TYPE i,
    l_content_type TYPE w3param-cont_type,
    l_content_subtype TYPE w3param-cont_type.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'c:\file.gif'
    filetype = 'BIN'
    HAS_FIELD_SEPARATOR = ' '
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    IMPORTING
    filelength = l_content_length
    HEADER =
    TABLES
    data_tab = mime
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17
    .
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT i_igs_image_converter .
    i_igs_image_converter->input = 'image/gif'.
    i_igs_image_converter->output = 'image/bmp'.
    i_igs_image_converter->width = '100'.
    i_igs_image_converter->height = '100'.
    CALL METHOD i_igs_image_converter->set_image
    EXPORTING
    blob = mime
    blob_size = l_content_length.
    CALL METHOD i_igs_image_converter->execute
    EXCEPTIONS
    communication_error = 1
    internal_error = 2
    external_error = 3
    OTHERS = 4.
    IF sy-subrc = 0.
    CALL METHOD i_igs_image_converter->get_image
    IMPORTING
    blob = blob
    blob_size = blob_size
    blob_type = blob_type.
    DATA dsn1(20) TYPE c VALUE 'c:\test.bmp'.
    DATA wa_mime1 TYPE w3mime.
    OPEN DATASET dsn1 FOR OUTPUT IN BINARY MODE.
    LOOP AT blob INTO wa_mime1.
    TRANSFER wa_mime1 TO dsn1.
    CLEAR wa_mime1.
    ENDLOOP.
    CLOSE DATASET dsn1.
    ELSE.
    DATA: num TYPE i, message TYPE string.
    CALL METHOD i_igs_image_converter->get_error
    IMPORTING
    number = num
    MESSAGE = message.
    ENDIF.

    Should it help on your topic, please kindly accept the answer.

    Cheers,

    Luis

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 17 at 11:48 PM
    1. Upload jpg-file(s) Select files from Computer, Google Drive, Dropbox, URL or by dragging it on the page.
    2. Choose "to bmp" Choose bmp or any other format you need as a result (more than 200 formats supported)
    3. Download your bmp.
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.