Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
thinkingpixels
Topic Author
Posts: 14
Joined: 06 Jul 2016, 18:27

Wrong og:image when sharing deeplinked images on Facebook

08 Jul 2016, 11:13

Hi,

when I share a deeplink to an image in my gallery on Facebook, the og:image, that is being fetched, is always the album preview, not the actual image I'm linking to. How can I fix this, so that when somebody shares a link to one of my images, Facebook fetches the actual image as og:image?

Cheers,
André
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14002
Joined: 30 Sep 2006, 03:37

Re: Wrong og:image when sharing deeplinked images on Faceboo

08 Jul 2016, 11:26

Link please ... and what "deeplink" are you sharing? Are you copy-pasting the link directly from your browser? Or do you mean when clicking to share from the actual sharing buttons?
 
User avatar
thinkingpixels
Topic Author
Posts: 14
Joined: 06 Jul 2016, 18:27

Re: Wrong og:image when sharing deeplinked images on Faceboo

08 Jul 2016, 12:43

I'm copying the link from the browser address bar, like this one:
http://gallery.thinkingpixels.com/Peopl ... e-img-1162
I would like the og:image to be the same than the one this link leads to - Facebook is fetching the album preview image instead.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14002
Joined: 30 Sep 2006, 03:37

Re: Wrong og:image when sharing deeplinked images on Faceboo

09 Jul 2016, 01:29

thinkingpixels wrote:I'm copying the link from the browser address bar, like this one:
http://gallery.thinkingpixels.com/Peopl ... e-img-1162
I would like the og:image to be the same than the one this link leads to - Facebook is fetching the album preview image instead.
Unfortunately, that is not technically or logically possible, not in X3 or any other application. That is why you have the "sharing" buttons available instead:
Image

Why? Because Facebook sends robots to load the shared page and extract the og:image from the page source. The popup link you are referring to with #&gid=1&pid=ophelia-overdose-img-1162 is still the album page with a popup overlay. To even achieve being able to share images in the first place, one needs to have unique "image landing pages" available, such as in X3. For example:
https://demo.photo.gallery/galleries/femme/forest/

Thus, to be able to share the image directly, and include an og:image in the page source itself, one has to share the image landing page. This is what the built-in sharing buttons do for you. Although you can "copy paste" a popup link url, and it will still link to the same image in the popup window, it will not share a unique image page, and thus will not contain a unique og:image.
 
User avatar
thinkingpixels
Topic Author
Posts: 14
Joined: 06 Jul 2016, 18:27

Re: Wrong og:image when sharing deeplinked images on Faceboo

09 Jul 2016, 09:11

Hm... The thing is, I would really prefer not to have a share button in my gallery for legal reasons - I don't mind people sharing my images for private use on Facebook or whatever, but I have a problem with people stealing and using my imagery commercially. So when someone steals my image and uses it e.g. on his commercial website, my lawyer will sent him a cease and desist, including damages. But I had the experience that the other site often tries to lower the damages if there is a sharing mechanism on the basis that they say "but we thought you wanted people to share your images"... Long story short: I'd prefer not to have that share button. :)

But:
When I click on an image and my gallery uses popup, the URL in the browser's address bar changes to something like this:
http://gallery.thinkingpixels.com/Peopl ... e-img-1162
This is not actually the landing/detail page for the image, but the album with the image opened as a popup, just like you described.

The landing/detail page URL would be:
http://gallery.thinkingpixels.com/Peopl ... _IMG_1162/

Right? So, the changing of the URL in the browser's address bar, how is that done? Does this use mod_rewrite? Would it not be possible, to simple display the image as popup like I'm doing now, but when I open an image, the URL is changed to display the landing page URL instead?

TL;DR: Would it be possible, that even when using popup to display images, that when you click on an image to open it, the URL in the browsers address bar is updated to display the image's landing page URL instead?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14002
Joined: 30 Sep 2006, 03:37

Re: Wrong og:image when sharing deeplinked images on Faceboo

10 Jul 2016, 04:57

thinkingpixels wrote:Hm... The thing is, I would really prefer not to have a share button in my gallery for legal reasons - I don't mind people sharing my images for private use on Facebook or whatever, but I have a problem with people stealing and using my imagery commercially. So when someone steals my image and uses it e.g. on his commercial website, my lawyer will sent him a cease and desist, including damages. But I had the experience that the other site often tries to lower the damages if there is a sharing mechanism on the basis that they say "but we thought you wanted people to share your images"... Long story short: I'd prefer not to have that share button. :)
Sorry, but I don't understand what this has to do with anything. The "share" button we are speaking of, does exactly what you are asking for, shares the image (with preview), nothing more nothing less. Besides, you can disable the sharing if you want, but then obviously it will not be possible to share ... I don't see what this has to do with people stealing your images. How will they they not be stealing your images if you share from the popup link if that was possible? The image is already there anyway ...
thinkingpixels wrote:When I click on an image and my gallery uses popup, the URL in the browser's address bar changes to something like this:
http://gallery.thinkingpixels.com/Peopl ... e-img-1162
This is not actually the landing/detail page for the image, but the album with the image opened as a popup, just like you described.
The link above gallery.thinkingpixels.com/People/Artwork/#&gid=1&pid=ophelia-overdose-img-1162, is in fact as you have stated, the album page. Although you are interactively viewing an image in a popup, the page is in fact still the album page. When facebook visits that page, it will read the source code for the og:image, and get the preview image for that album page. Nothing can change that.

What follows the #hashtag does not define the page, and even if it did, Facebook ignores it. Even if we DID in fact interactively, by javascript, change the og:image in the source code by javascript, this would also be ignored by Facebook ... Facebook reads the original page source only, and a "web page" is not expected to changing content.
thinkingpixels wrote:The landing/detail page URL would be:
http://gallery.thinkingpixels.com/Peopl ... _IMG_1162/
That is a unique page yes, and what we in X3 call "landing pages". We did not create this feature just for fun. We created it so users would be able to share images, something which is simply not possible from a popup window.
thinkingpixels wrote:Right? So, the changing of the URL in the browser's address bar, how is that done?
It is done with #HASH, and technically this is NOT changing the URL. #Hashes are meant to be used for basic javascript-only moderation of content. In this case, its still the same album page, but it's basically telling the visitor and the browser: "Ok, so this is the album page, but we have a popup window showing an image with ID ***".
thinkingpixels wrote:Does this use mod_rewrite?
No. Changing everything after #hash is not changing the page.
thinkingpixels wrote:Would it not be possible, to simple display the image as popup like I'm doing now, but when I open an image, the URL is changed to display the landing page URL instead?
If you DISABLE the X3 popup feature, it will navigate to the landing page instead. However, this is a much less functional viewing mode for human visitors.
thinkingpixels wrote:TL;DR: Would it be possible, that even when using popup to display images, that when you click on an image to open it, the URL in the browsers address bar is updated to display the image's landing page URL instead?
Unfortunately, it's a bad idea to "fake" the url, which tells the browser, robots and visitors that they are on another page than they actually are. Basically the url will say they are on the image landing page, while they are still on the album page. I could go into detail, but it's simply not a good idea.

We could create another url, but it would just mean we end up with another near-identical landing page. ALL web pages with unique urls (excluding #hash), need to be unique web pages.

Must say, I really don't understand your problem. You want to disable sharing so that people can't share, yet you want to be able to share through the link? I can only see a paradox ...
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14002
Joined: 30 Sep 2006, 03:37

Re: Wrong og:image when sharing deeplinked images on Faceboo

10 Jul 2016, 06:09

Thinking a bit further, it could be technically possible that we update the URL field to something like ?popup=image_name. When sharing this URL, X3 could redirect the request to the image landing-page. Thus, you would get the preview-image when sharing the URL. It's still a bit ugly though:

# It would need to be a redirect because ?popup=image_name wouldn't technically be a unique page.

# Changing URLs dynamically, forces EXIT from fullscreen mode in most modern browsers. This is a browser security implementation, to make sure the visitor is aware of the current URL they are visiting. This does not apply for the #hash.

# It would have to be an option in settings. Many users want to share the link in URL, and get directly to the functional popup viewer, and not the landing page.

# Although it will work, Facebook debugger will probably report that the URL is redirected, something which slows down the process.

I would be hesitant to implement something like this, as I don't really see any functional benefits.