• Resolved timjh

    (@timjh)


    In the hope that this will save someone else from tearing their hair out:

    I’ve signed up to Azure in the UK. As well as setting the endpoint to https://uksouth.api.cognitive.microsoft.com/, I found that I had to edit automatic-alternative-text.php (about line 260) to change the appended resource request from ‘describe’ to ‘vision/v1.0/analyze?visualFeatures=Description’.

    Perhaps I’ve missed something and there is another way of doing this, but it works for me.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi timjh,

    thank you for that important hint! It looks like the API has changed:
    https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fa

    I changed the code as described by you but still have the problem that no image description appears.

    Maybe this is a stupid question, but where in the WordPress backend do I “trigger” the recognition process? When I click in the media library on an image the “Alternative Text” field stays empty whatever I do…

    I appreciate any hint or help! ??

    Thank you!
    Oliver

    Thread Starter timjh

    (@timjh)

    Oliver,

    The “trigger” is simply the uploading of a new image to the Media Library. There’s no way (as the plugin stands at the moment) to generate the alt text for an image already in the library.

    BTW, just to be sure that you have got the Request URL exactly right, the trick that got me to the right answer was to use the “API Testing console” that is linked from the Microsoft page that you referenced. There you can see exactly what is sent to the API and what comes back. All I did then was to hack the plugin code to match it.

    Good luck!
    Tim

    Plugin Author Jacob Peattie

    (@jakept)

    @timjh Sorry for the late response (I’ve been swamped at my day job), but I’ve double checked and there hasn’t been a change in the API (APIs should never change without changing their version). The plugin uses the describe endpoint of version 1.0 of the API, as described here: https://westus.dev.cognitive.microsoft.com/docs/services/56f91f2d778daf23d8ec6739/operations/56f91f2e778daf14a499e1fe

    What *has* changed is that the Endpoint that Microsoft displays for the resource in the Azure Portal no longer includes the vision/v1.0 part that it used to. This means if you copy the endpoint as provided by Microsoft, the plugin won’t work, because it expected it to include vision/1.0 at the end.

    So rather than editing the plugin, the quick solution is to update your Endpoint in Setting to include the missing part:

    
    https://uksouth.api.cognitive.microsoft.com/vision/1.0
    

    I will work on an update to automatically include this if it wasn’t added by the user.

    Thanks for bringing this to my attention.

    Plugin Author Jacob Peattie

    (@jakept)

    I’ve released an update for the plugin, which should be live soon, that supports endpoint URLs that are missing vision/1.0. If you’re using a URL that already includes it, you won’t need to do anything, but the plugin should work correctly now if you just copy the endpoint URL as provided by Azure.

    Thread Starter timjh

    (@timjh)

    @jakept Thanks for your explanation and for sorting this out. I was waiting for the update before replying, but I’ve seen no sign of it yet. However, I’ve updated my endpoint setting as you suggested and reverted to the original plugin. I can confirm that it all works as expected.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Endpoint for uksouth’ is closed to new replies.