Display PHP image by load () or html ()

0

I created a file in PHP, which uses the WideImage library (with header header ("Content-type: image / jpeg")) to manipulate images. Within this file, I capture some parameters via GET and create an image from these parameters. So far so good.

The problem is that, I need to send these parameters from an external page to this one, and then that generated image in the file quoted above needs to return to that external one.

I'm sending everything via AJAX, but in both the jQuery load () and html () method, the generated image is all encoded, as if there was no image / jpg header.

Can anyone help me fix this? Below is the excerpt from JS that I wrote.

  $("#start").click(function(){                                 
        var request = $.ajax({
                          url: 'gd.php',
                          type: "GET",
                          data: {
                                dados
                          },                                                    
                          success: function(data) {
                            //data = $.parseJSON(data);
                            console.log(data);
                            $('#gera-img').html(data);
                          },
                          beforeSend: function(){
                            $('#start').css("display", "none");
                            $('.loader').css("display", "block");                               
                          },
                          complete: function(){
                            $('.loader').css("display", "none");
                          }                           
                        });

         });
    
asked by anonymous 21.09.2017 / 23:13

0 answers