Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


This forum is in read only mode, you can no longer reply
  • Giorgio 4 posts 74 karma points
    Jul 01, 2016 @ 12:57
    Giorgio
    0

    Facebook Images and ImageProcessor.Web

    Hello.

    I am trying to use imageprocessor.web to crop an image coming from Facebook Graph API.

    The URL of the image that I get from the Graph API field (“full_picture”) is:

    https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/130919289377114863447082713745171335119158_n.jpg?oh=49394c5fa01be55639ee665752aeea35&oe=5800CA66

    When I add to the query string &anchor=center&mode=crop&width=248&height=93

    the image does not show anymore.

    https://scontent.xx.fbcdn.net/v/t1.0-9/s720x720/130919289377114863447082713745171335119158_n.jpg?oh=49394c5fa01be55639ee665752aeea35&oe=5800CA66&anchor=center&mode=crop&width=248&height=93

    I have tried using /remote.axd/ but it did not make any difference.

    Anyone can point me in the right direction?

    Thank you.

  • Rhys Hamilton 20 posts 89 karma points
    Jul 01, 2016 @ 13:13
    Rhys Hamilton
    0

    Assuming that the image appears prior to including the query string, I believe I may have a solution.

    This is just a stab in the dark but perhaps the s720x720 in the URL refers to the size (s) of the image (720x720).

    You could try altering the URL to something along the lines of:

    https://scontent.xx.fbcdn.net/v/t1.0-9/s248x93/130919289377114863447082713745171335119158_n.jpg?oh=49394c5fa01be55639ee665752aeea35&oe=5800CA66

    I may be wrong, but it might be worth trying out.

  • Giorgio 4 posts 74 karma points
    Jul 01, 2016 @ 14:31
    Giorgio
    0

    Hi Rhys,

    Thank you for your suggestion.

    I tried but it did not work,I would guess that "s720x720" is a folder.

  • Rhys Hamilton 20 posts 89 karma points
    Jul 01, 2016 @ 14:59
    Rhys Hamilton
    0

    Hi Giorgio,

    You may very well be right! I had a quick look online and came across a (hopefully) useful link: https://developers.facebook.com/docs/graph-api/reference/page/picture/

    From what I have read, in order to achieve your desired result, images should be formatted something along the lines of:

    https://graph.facebook.com/4/picture?width=100&height=100

    This may explain why using ImageProcessor.Web to crop a Facebook image fails to display the expected result.

    Hopefully this helps to - at the very least - point you in the right direction.

  • Giorgio 4 posts 74 karma points
    Jul 01, 2016 @ 20:49
    Giorgio
    0

    Hi Rhys

    Thank you for your help... I think that is very useful and hopefully pointing me in the right direction.

    What I am trying to get are the photos included in the posts from a user feed.

    /{user-id}/posts

    https://developers.facebook.com/docs/graph-api/reference/v2.6/user/feed

    when I query https://graph.facebook.com/371535272962335/posts?fields=fullpicture,message,createdtime&access_token=****";

    I get back a JSON response that contains "full_picture":

    "data": [ { "fullpicture": "https://scontent.xx.fbcdn.net/v/t1.0-9/134507499674281367063769197606519706136545n.jpg?oh=ed050343e82bef662ad9fcdc992b461b&oe=57EDD623", "message": "Happy coding to everyone", "createdtime": "2016-06-18T07:05:45+0000", "id": "371535272962335967428136706376" },

    I tried to pass the object id to the following call: https://graph.facebook.com/371535272962335963422297106960/picture?width=100&height=100&accesstoken=**

    but that returned an error:

    (#12) picture edge for this type is deprecated for versions v2.3 and higher

    I think I will try to post on the FB grap api forum and see if anyone has any idea if it can be done, but if you have any other suggestions please let me know.

    Thanks again

  • James Jackson-South 489 posts 1747 karma points c-trib
    Jul 03, 2016 @ 23:24
    James Jackson-South
    0

    Hi Giorgio?

    Have you added the url to the whitelist in the security.config file?

    http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/#remote

    <add url="https://fbcdn.net"/>
    <add url="http://fbcdn.net"/>
    

    You might also have to set the default Protocol value as https though I'd have to debug to remember, I don't know if Facebook will redirect or refuse the request.

    <setting key="Protocol" value="https"/>
    

    Cheers

    James

  • Giorgio 4 posts 74 karma points
    Jul 05, 2016 @ 09:37
    Giorgio
    0

    Hi James

    Thank you for your help.

    I have tried what you suggested but unfortunately is still not working.

    The following is my security.config file, I tried witht LocalFileImageService and with CloudImageService and I get the same result.

    <?xml version="1.0" encoding="utf-8"?>
    

    And here is my HTML

    <img src="/remote.axd/www.100annidipro.com/media/1130/logo-aurora.png?width=100&height=300&mode=crop" />
        <br />
        <img alt="" src="localPhoto.JPG?oh=49394c5fa01be55639ee665752aeea35&oe=5800CA66&width=100&height=300&mode=crop" /><br />
        <br />
        <br />
        <img src="/remote.axd/scontent.xx.fbcdn.net/v/t1.0-9/s720x720/13091928_937711486344708_2713745171335119158_n.jpg?oh=49394c5fa01be55639ee665752aeea35&oe=5800CA66&width=100&height=390&mode=crop" />
    

    The first two images display fine and crop correctly but the third image coming from FB is not showing and I get the following error 500 internal server error:

    GET http://localhost:64110/remote.axd/scontent.xx.fbcdn.net/v/t1.0-9/s720x720/1…9394c5fa01be55639ee665752aeea35&oe=5800CA66&width=100&height=390&mode=crop 500 (Internal Server Error)
    

    If you have any other suggestions please let me know.

    Thank you.

  • ZNS 60 posts 198 karma points
    Nov 21, 2016 @ 12:56
    ZNS
    0

    I've contributed to Imageprocessor to resolve this so it should work in the next release of ImageProcessor. You'll need to add a useragent setting to the remote service setting though.

Please Sign in or register to post replies

Write your reply to:

Draft