<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Showkase Support Forum — Showkase and PHP]]></title>
		<link>https://showkase.net/forum/viewtopic.php?id=472</link>
		<atom:link href="https://showkase.net/forum/extern.php?action=feed&amp;tid=472&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Showkase and PHP.]]></description>
		<lastBuildDate>Wed, 24 Jan 2024 20:37:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2307#p2307</link>
			<description><![CDATA[<p>@Koinelendot</p><p>It&#039;s a shame that a new version of Showkase has not yet been released with an implementation of the fix above but my code (from <a href="https://showkase.net/forum/viewtopic.php?pid=2234#p2234">this post</a>) is a complete solution to the problem with no known adverse side affects for those experiencing (or not experiencing) the problem.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Wed, 24 Jan 2024 20:37:07 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2307#p2307</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2239#p2239</link>
			<description><![CDATA[<p>@petax</p><p>I&#039;ll glad the fix helped. Thank you for letting me know.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Sat, 18 Mar 2023 21:31:22 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2239#p2239</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2237#p2237</link>
			<description><![CDATA[<p>I had this exact same problem, thanks for the fix.</p>]]></description>
			<author><![CDATA[null@example.com (petax)]]></author>
			<pubDate>Sat, 18 Mar 2023 13:05:39 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2237#p2237</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2236#p2236</link>
			<description><![CDATA[<p>That&#039;s good to hear. Thanks for testing!</p><p>I&#039;ve notified the developers of this fix so it will be included in the next version (but I don&#039;t know when this might be).</p><p>Best wishes!</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Fri, 17 Mar 2023 21:18:35 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2236#p2236</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2235#p2235</link>
			<description><![CDATA[<p>Hello Steven,<br />It seems that everything is working correctly now. Thank you very much for your help.</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Fri, 17 Mar 2023 12:23:59 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2235#p2235</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2234#p2234</link>
			<description><![CDATA[<p>Thank you, once again, for all the information that you have provided. It really does make troubleshooting that much easier.</p><p>I was instantly able to replicate the problem by setting thumbnail dimensions of 81 x 54 and I see that I overlooked a couple of other variables (<strong>cropHeight </strong>and <strong>cropWidth</strong>) that could potentially not be integers (where integers are required).</p><p>However, rather than changing their definitions in the code (like I did previously for <strong>deltaX </strong>and <strong>deltaY </strong>in my original fix), it might be better to ensure that <span class="bbu">all</span> numeric variables are integers for the two functions that require integers, which will also cover the edge case of a user entering decimal values for thumbnail dimensions in the Showkase interface (which, ideally, should not happen but is technically possible).</p><p>So, here&#039;s a new fix.<br />From a fresh, unmodified &#039;thumbnail.php&#039; file:</p><p>(1) Change line 110 from:<br /></p><div class="codebox"><pre><code>$imageDest = imagecreatetruecolor($thumbWidth, $thumbHeight);</code></pre></div><p>... to:<br /></p><div class="codebox"><pre><code>$imageDest = imagecreatetruecolor((int)$thumbWidth, (int)$thumbHeight);</code></pre></div><p>(2) Change line 116 from:<br /></p><div class="codebox"><pre><code>if (!imagecopyresampled($imageDest, $imageSrc, 0, 0, $deltaX, $deltaY, $thumbWidth, $thumbHeight, $cropWidth, $cropHeight)) {</code></pre></div><p>... to:<br /></p><div class="codebox"><pre><code>if (!imagecopyresampled($imageDest, $imageSrc, 0, 0, (int)$deltaX, (int)$deltaY, (int)$thumbWidth, (int)$thumbHeight, (int)$cropWidth, (int)$cropHeight)) {</code></pre></div><p>I hope this completely fixes the problem this time around.<br />Thanks again for your help and for reporting the problem in the first instance.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Fri, 17 Mar 2023 03:24:12 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2234#p2234</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2233#p2233</link>
			<description><![CDATA[<p>Hi again Steven, I have sent you a second email with some clues found in new tests that I have carried out, related to the parameters established for the generation of thumbnails. Let&#039;s see if they help for the analysis.</p><p>Thanks again.</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Fri, 17 Mar 2023 01:05:44 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2233#p2233</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2232#p2232</link>
			<description><![CDATA[<p>Hi Steven, I have sent you a new email with other images that give me an error and some more details. See if you can identify the problem. Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Thu, 16 Mar 2023 22:53:30 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2232#p2232</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2231#p2231</link>
			<description><![CDATA[<p>That&#039;s strange.<br />I tested the fix with all three of your source images yesterday and all three images uploaded without issue.<br />I&#039;ve just checked again today with &#039;Image2.jpg&#039; from your most recent email and, again, it works without any errors or warnings at all.<br />(I&#039;ve been testing with Showkase v1.7.6 under PHP 8.1.1.6.)</p><p>There must be some other difference between our setups that is causing the problem but not being able to replicate the problem makes troubleshooting difficult.</p><p>What version of PHP are you using? Is it PHP 8.1.0 or another version in the 8.1 branch?<br />Do you have any custom image sizes set within Showkase or are all image sizes defaults?<br />Do you have any other images that still fail (with the fix in place) that I can use to test with? Maybe I&#039;ll see a pattern in all the images that fail.</p><p>I&#039;ll keep looking at this but if you can provide any further information that might help me to pinpoint the problem (or replicate it), then that would be great.<br />Thanks.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Thu, 16 Mar 2023 22:05:06 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2231#p2231</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2230#p2230</link>
			<description><![CDATA[<p>Thanks Steven, </p><p>After replacing the Thumbnail.php file with the one you send me, I have retested all three images. Two of them have loaded without problem, but Image2 continues to give an error (in the same step, but different number than the one it gave yesterday). It seems that the solution has been partial. I have send you an email with the details.</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Thu, 16 Mar 2023 08:05:10 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2230#p2230</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2229#p2229</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>I have looked for your email address but I could not find it in the post.</p></blockquote></div><p>That&#039;s odd. It should be located below my username to the left of each post.</p><p>Anyway, thank you for providing such a clear explanation of the problem and some source images.<br />I&#039;ve been able to replicate the problem (it&#039;s due to the deprecation I noted above) and have formulated a fix.</p><p>Until the fix can be integrated into a new version of Showkase, here are the details:</p><p>(1) Open your Showkase site&#039;s <em>admin/classes/thumbnail.php</em> file in a plain text editor.</p><p>(2) Change line 83 from:<br /></p><div class="codebox"><pre><code>$deltaY = ($imageHeight - $cropHeight)/2;</code></pre></div><p>... to:<br /></p><div class="codebox"><pre><code>$deltaY = (int)(($imageHeight - $cropHeight) / 2);</code></pre></div><p>(3) Change line 88 from:<br /></p><div class="codebox"><pre><code>$deltaX = ($imageWidth - $cropWidth)/2;</code></pre></div><p>... to:<br /></p><div class="codebox"><pre><code>$deltaX = (int)(($imageWidth - $cropWidth) / 2);</code></pre></div><p>(4) Save the &#039;thumbnail.php&#039; file with the changes above and re-upload it to your Showkase site&#039;s admin/classes/ folder, overwriting the existing &#039;thumbnail.php&#039; file.</p><p>Thank you for bringing this to our attention and apologies for any inconvenience caused.</p><p>Incidentally, the line numbers above refer to the current version of Showakse (v1.7.6).</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Wed, 15 Mar 2023 21:27:56 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2229#p2229</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2228#p2228</link>
			<description><![CDATA[<p>Hi Steven. I have looked for your email address but I could not find it in the post. Since you helped me with a similar problem years ago, I have sent you an email with the images and errors to the address I keep from then (Sep 2018). Please confirm if you have received it and if not, send me an email to be connected (miguel.benedicto@telefonica.net).</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Wed, 15 Mar 2023 16:07:31 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2228#p2228</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2227#p2227</link>
			<description><![CDATA[<p>Unfortunately, it looks like you&#039;ve run into an issue which no-one has reported before (most likely due to <a href="https://php.watch/versions/8.1/deprecate-implicit-conversion-incompatible-float-string">this deprecation</a> in PHP 8.1).</p><p>I&#039;ve not been able to replicate the problem myself with a batch of test images running Showkase-Pro v1.7.6 under PHP 8.1.1.</p><p>You can find my email address in the column to the left of this post (just look for and click the word &#039;Email&#039;). You&#039;ll need to be logged into the forum to see this.</p><p>I might be able to replicate the problem if I know the original dimensions of the source images that fail and your chosen resize dimension (but it would be better if I had access to the images that fail).</p><p>Please email me the images that fail if you can and I&#039;ll follow this up as soon as possible.<br />Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Tue, 14 Mar 2023 21:35:08 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2227#p2227</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2226#p2226</link>
			<description><![CDATA[<p>I have upgraded to Showkase 1.7.6, and with PHP 8.1 I get an error when uploading some images to the web (not all, a third of them). The error is: &quot;Unable to create new thumbnail(implicit conversion from float 0.5 to int loses precision) in thumbnail php, line 133&quot;.<br />I&#039;m not good at attaching images to the forum, perhaps if you provided me with an email address I could easily send them to you.</p>]]></description>
			<author><![CDATA[null@example.com (MBene)]]></author>
			<pubDate>Tue, 14 Mar 2023 09:45:10 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2226#p2226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Showkase and PHP]]></title>
			<link>https://showkase.net/forum/viewtopic.php?pid=2224#p2224</link>
			<description><![CDATA[<p>@MBene<br /></p><div class="quotebox"><blockquote><p>Could you confirm if that could be the problem...</p></blockquote></div><p>The only version of Showkase which is fully compatible with PHP 8.0 and 8.1 is the latest version (Showkase v1.7.6) so the use of Showkase v1.7.3 under PHP 8.0/8.1 <em>could </em>be the problem (though I can&#039;t be 100% sure).<br />Are you able to check your web server logs and browser developer tools console to see if you can find any warning or error messages that would give a reason for the problem? If we know exactly what the problem is, we&#039;d have a better chance of figuring out how to fix it.</p><p>I&#039;d certainly recommend upgrading Showkase to see if this resolves the issue.<br />Instructions for upgrading Showkase can be found <a href="https://showkase.net/support/upgrade/">here</a>.</p><p>Upgrading is essentially just a case of uploading the new Showkase source files on top of the existing installation so it should be a fairly quick and easy (and risk-free) process. You should not lose any custom data or pages (only source files are overwritten). (See link above for full details.) Having said, that, I&#039;d strongly recommend that you make a complete backup of your existing site first. Please check the notes below.</p><p><span class="bbu"><strong>Notes:</strong></span></p><p>(1) When upgrading your Showkase site, please be sure to make a complete backup of your existing site first, just in case anything should go wrong and you need to reinstate your original files at a later date. You should not encounter any problems upgrading Showkase but it would be wise to have a backup of your site should anything unexpected happen. Also, if you have made manual customizations to any Showkase source files or have used your theme&#039;s <em>custom.css</em> or <em>custom.js</em> files, then please note that these will be overwritten when you upgrade and you&#039;ll need a backup in order to reinstate them afterwards.</p><p>(2) Please remember that Showkase-Standard comes bundled with Juicebox-Lite (the free version of Juicebox) so, if you have purchased Showkase-Standard and Juicebox-Pro separately, then after upgrading your Showkase site, you&#039;ll need to reinstate your Juicebox-Pro files by following the Installing Juicebox Pro instructions <a href="https://www.showkase.net/support/#pro-install">here</a>.</p><p>(I included these notes are they might help others reading this thread. I know that you are a Showkase-Pro user and that Note #2 is not relevant to your case.)</p><p>I have sent you a new download link for your Showkase-Pro purchase so that you can download the latest version of Showkase (v1.7.6). (Download links always point towards the latest version rather than the version you purchased.)</p><p>I hope this helps but if you continue to experience difficulties, please post back to let me know (with further details of the problem, if possible) and I&#039;ll try to help further.<br />Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Showkase)]]></author>
			<pubDate>Mon, 13 Mar 2023 21:28:28 +0000</pubDate>
			<guid>https://showkase.net/forum/viewtopic.php?pid=2224#p2224</guid>
		</item>
	</channel>
</rss>
