Keyword

Image size when posting to facebook - Enable original size

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
5 years 9 months ago #171320 by George Nasis
Hallo,

is it possible to use the original size of photo uploaded when item is posted to facebook?

the 5 options are not including it. Is it possible even with a hack?

thank you

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #171329 by JoomlaWorks
>> Is it possible even with a hack?
Everything is possible but I would avoid such solutions.

Isn't the XL size more than enough already?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
5 years 9 months ago #171336 by George Nasis
As options are indeed enough but as concern the image size sometimes the xl option reduce the quality as not all images that uploaded are same dimensions.

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #171337 by JoomlaWorks
You can simply switch quality to 100% as seen here: jmp.sh/BeJrBzr

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
5 years 9 months ago #171339 by George Nasis
Yes of course Fotis I got your point, but for example I upload an image with width 1000px and the XL is set to 800px.

My goal is Facebook to retrieve the original image with 1000px not the 800px. Sure you will tell me to set 1000px to XL but many images that I upload maybe are 500 px. So from 500px to transform to 1000px will break the quality.

Please Log in or Create an account to join the conversation.

More
5 years 9 months ago #171341 by JoomlaWorks
OK, like I said, although I don't endorse this (your posts may be blocked if someone uploads a 3000x3000 pixels image), you can overwrite the meta tags that K2 sets for open graph sharing and then manually change the path to use:

If an XL image's path is e.g. getk2.org/media/k2/items/cache/08a4cf1e44f783c853b207a033a173b9_XL.jpg then the source file is getk2.org/media/k2/items/src/08a4cf1e44f783c853b207a033a173b9.jpg

As you can see, the filename is the same sans "_XL" and the path switches to /media/k2/items/src from /media/k2/items/cache.

First off, upgrade to v2.9.1 (dev) as it introduces new & fixed meta tags for open graph/twitter: github.com/getk2/k2/archive/master.zip

Then, in your item.php override, add this snippet at the very top of the file (replace existing comments etc. accordingly):
<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2019 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */
// no direct access
defined('_JEXEC') or die;

$document = JFactory::getDocument();              
if (JFile::exists(JPATH_SITE.'/media/k2/items/src/'.md5("Image".$this->item->id).'.jpg')) {
	$image = JURI::root().'media/k2/items/src/'.md5("Image".$this->item->id).'.jpg';
	$document->setMetaData('og:image', $image);
	$document->setMetaData('image', $image); // Generic meta
}

?>

Let me know.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
5 years 9 months ago #171344 by George Nasis
Thank you very much Fotis,

I will let you know when I am ready as I had avoid upgrading because of removed functionality of CB of newer versions of K2

Thank you a lot and keep up the good work

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #171347 by JoomlaWorks
It should work even on older K2 releases. Keep in mind that the integration we removed does not affect K2 content, just the integration between the 2 components.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
5 years 8 months ago #171349 by George Nasis
Yes sure, I am aware of that..

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #171351 by JoomlaWorks
Great!

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum