Keyword

Item Pics broken after K2 2.10.1 update - Problem Identified

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago - 4 years 4 months ago #173858 by Benoit de Mulder
Item Pics broken after K2 2.10.1 update was created by Benoit de Mulder
Hello,

All items pics in directory stopped to appear after the upgrade, Image url is not valid and the name of the item appears twice...
No code change was done on my side, it is a custom k2 template working since Joomla 2.5.
I downgraded K2 and it solved the problem


- Do you have an ETA for a fix or can you point on code change that would contribute to this ?

Thanks

Benoit
Last edit: 4 years 4 months ago by Benoit de Mulder.

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

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago #173859 by Benoit de Mulder
Replied by Benoit de Mulder on topic Item Pics broken after K2 2.10.1 update
More info:
Html code : <!-- Item title -->
<h4 class="catItemTitle">
<a href="/aircraft-s/supermarine/item/55737-a-p-1565-g-h-pilot-s-notes-for-spitfire-mark-f-vii-f-viii">
<img src="/" align="middle" alt="A.P. 1565 G &amp;amp; H Pilot&amp;#039;s Notes for Spitfire Mark F.VII &amp;amp; F.VIII" style="width:80px; height:auto;" />
</a>
<a href="/aircraft-s/supermarine/item/55737-a-p-1565-g-h-pilot-s-notes-for-spitfire-mark-f-vii-f-viii">
A.P. 1565 G &amp; H Pilot&#039;s Notes for Spitfire Mark F.VII &amp; F.VIII </a>
</h4>

php code:
<h4 class="catItemTitle">

<a href="<?php echo $this->item->link; ?>">
<img src="<?php echo $this->item->imageXSmall; ?>" align="middle" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:80px; height:auto;" />
</a>
<?php if ($this->item->params->get('catItemTitleLinked')): ?>
<a href="<?php echo $this->item->link; ?>">
<?php echo $this->item->title; ?>
</a>
<?php else: ?>
<?php echo $this->item->title; ?>
<?php endif; ?>

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

More
4 years 4 months ago #173876 by JoomlaWorks
Replied by JoomlaWorks on topic Item Pics broken after K2 2.10.1 update
Have you deleted any images from the K2 /media/k2/items/cache/ folder?

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

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

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago #173885 by Benoit de Mulder
Replied by Benoit de Mulder on topic Item Pics broken after K2 2.10.1 update
Nothing was deleted and the problem is reproducible, I just used the built-in upgrade process in Joomla as I do usually.

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

More
4 years 4 months ago #173886 by JoomlaWorks
Replied by JoomlaWorks on topic Item Pics broken after K2 2.10.1 update
Do you mean perhaps that it appears as images are broken when in fact there are none to be displayed? This may be due to a different setting for the image object which can cause certain code checks (like "if(isset($this->item->image)...") to return true and thus display the <img> tag with an empty src attribute. If that's the case, simply change these isset() checks with !empty().

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

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

More
4 years 4 months ago #173887 by JoomlaWorks
Replied by JoomlaWorks on topic Item Pics broken after K2 2.10.1 update
Additionally, you can momentarily upgrade to 2.10.1 if you want and notify me with the pages that have issues to have a quick look.

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

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

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago #173888 by Benoit de Mulder
Replied by Benoit de Mulder on topic Item Pics broken after K2 2.10.1 update
I just did the upgrade: www.avialogs.com/aircraft-s/supermarine/itemlist/category/823-spitfire

All items have images, the whole site is impacted, (more than 17k items)

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

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago - 4 years 4 months ago #173889 by Benoit de Mulder
Replied by Benoit de Mulder on topic Item Pics broken after K2 2.10.1 update
I downgraded again as I think I have identified why there is such problem (but not solved). When item images are created through the module, it works. Most of my items are uploaded trough a batch process where I generate images from PDF, I create them with this code:

//K2 image
//
$pathimgk2 = "$pathimg$imageone.jpg";

$string = md5("Image".$k2id);
$filename=$string."jpg";
$filenamexl=$string."_XL.jpg";
$filenamel=$string."_L.jpg";
$filenamem=$string."_M.jpg";
$filenames=$string."_S.jpg";
$filenamexs=$string."_XS.jpg";
$filenameg=$string."_GENERIC.jpg";


exec ("convert $pathimgk2 /home/www/mysite/media/k2/items/src/$filename");
exec ("convert -resize 800 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenamexl");
exec ("convert -resize 600 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenamel");
exec ("convert -resize 400 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenamem");
exec ("convert -resize 200 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenames");
exec ("convert -resize 100 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenamexs");
exec ("convert -resize 300 $pathimgk2 /home/www/mysite/media/k2/items/cache/$filenameg");

I compared two images, one created by K2 trough the component, and one by the batch, both are with correct permissions.
So there is something different in the way the 10.0 and 10.1 are handling images

UPDATE: I tried the 10.2 dev and it did not solve the issue.
Last edit: 4 years 4 months ago by Benoit de Mulder.

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

More
4 years 4 months ago #173890 by JoomlaWorks
Replied by JoomlaWorks on topic Item Pics broken after K2 2.10.1 update
The problem is with the "generic" size. Linux is case sensitive, so the right filename is not:
$filenameg=$string."_GENERIC.jpg";

but:
$filenameg=$string."_Generic.jpg";

Change that and things will work again. The reason this will make things work is because we only use the generic size to check for image existence as there is no point in doing 6 filepath checks per item.

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

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

  • Benoit de Mulder
  • Benoit de Mulder's Avatar Topic Author
  • Offline
  • New Member
More
4 years 4 months ago - 4 years 4 months ago #173891 by Benoit de Mulder
I guess people with K2 installation migrated from old install ( this site is using K2 since 2013) will have the same issue.
Do you plan to fix this with the upcoming 10.2 or I should batch update my item images? (site has around 22000 items)
Last edit: 4 years 4 months ago by Benoit de Mulder.

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


Powered by Kunena Forum