Keyword

Image size when posting to facebook - Enable original size

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
2 months 3 weeks ago #171320 by George Nasis
George Nasis created the topic: Image size when posting to facebook - Enable original size
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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 3 weeks ago #171329 by Fotis
Fotis replied the topic: Image size when posting to facebook - Enable original size
>> 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?


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
2 months 3 weeks ago #171336 by George Nasis
George Nasis replied the topic: Image size when posting to facebook - Enable original size
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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 3 weeks ago #171337 by Fotis
Fotis replied the topic: Image size when posting to facebook - Enable original size
You can simply switch quality to 100% as seen here: jmp.sh/BeJrBzr


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
2 months 3 weeks ago #171339 by George Nasis
George Nasis replied the topic: Image size when posting to facebook - Enable original size
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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 3 weeks ago #171341 by Fotis
Fotis replied the topic: Image size when posting to facebook - Enable original size
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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
2 months 3 weeks ago #171344 by George Nasis
George Nasis replied the topic: Image size when posting to facebook - Enable original size
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.

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 3 weeks ago #171347 by Fotis
Fotis replied the topic: Image size when posting to facebook - Enable original size
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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • George Nasis
  • George Nasis's Avatar Topic Author
  • Offline
  • Elite Member
More
2 months 3 weeks ago #171349 by George Nasis
George Nasis replied the topic: Image size when posting to facebook - Enable original size
Yes sure, I am aware of that..

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 months 3 weeks ago #171351 by Fotis
Fotis replied the topic: Image size when posting to facebook - Enable original size
Great!


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white

Powered by Kunena Forum