Fb.ui feed share dialog box crop image after share

406 views Asked by At

**Here is My Code Below ** I Try to share dynamic image from my website to facebook using fb.ui feed dialog box. here is my code of share dialog box. but image was crop after the image was share. i share screen short with you,

function share_prompt()
{
    document.getElementById('shareImg').setAttribute("style","height:370px");
var element = $("#shareImg");
        var getCanvas;
     html2canvas(element, {
     onrendered: function (canvas) {

             var base64Image = canvas.toDataURL();

            console.log(base64Image);

            $.ajax({
                url: "save_image.php",
                type:"POST",
                data: {image: base64Image, id: <?php echo $t; ?> },
                success: function(response)
                {
                    $("#shareImg").css({
                            "height": "",

                        });
                      FB.ui(
                           {
                             method: 'feed',
                             name: 'What do you Think For This?',
                             link: 'http://voteit.in/que_detail.php?pid=<?php echo $pid ?>',

                             picture: 'http://voteit.in/poll_result/<?php echo $t ?>.png',
                             caption: 'www.voteit.in',
                             description: 'Your Friends has Already Given There opinions For Above Question. Provide Yours!',
                             author : 'voteit.in',


                             message: ''

                           },
                           function(response) {
                             if (response && response.post_id) {

                             } else {
                              // alert('Post was not published.');
                             }
                           }
                         );

                }
            });
           // $("#previewImage").append(canvas);
            //getCanvas = canvas;

         }

     });

}

In Mac After Sharing Image

0

There are 0 answers