<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP upload, resize and crop image class</title>
	<atom:link href="http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/</link>
	<description>Online Marketing, SEO, Search engine optimisation, optimization, Web Development, digital strategy, digital strategist, online marketing consultant</description>
	<lastBuildDate>Mon, 30 Jan 2012 03:18:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jimmy</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-296</link>
		<dc:creator>Jimmy</dc:creator>
		<pubDate>Mon, 30 Jan 2012 03:18:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-296</guid>
		<description>Great script!&lt;br&gt;&lt;br&gt;But I still got a problem with the png transparency. I&#039;m using the updated version with the cropping support. I saw an old comment talking about the same thing, but that was for the older version without the crop feature. I tried different things, but I still got black instead of transparency...&lt;br&gt;&lt;br&gt;By the way, there&#039;s no big deal, but I have another trouble. Is there a way to don&#039;t upload all the resized pictures ? I just need the original, the medium and small thumbnails.&lt;br&gt;&lt;br&gt;Please somebody help me!</description>
		<content:encoded><![CDATA[<p>Great script!</p>
<p>But I still got a problem with the png transparency. I&#39;m using the updated version with the cropping support. I saw an old comment talking about the same thing, but that was for the older version without the crop feature. I tried different things, but I still got black instead of transparency&#8230;</p>
<p>By the way, there&#39;s no big deal, but I have another trouble. Is there a way to don&#39;t upload all the resized pictures ? I just need the original, the medium and small thumbnails.</p>
<p>Please somebody help me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Conradie</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-291</link>
		<dc:creator>Stefan Conradie</dc:creator>
		<pubDate>Wed, 30 Nov 2011 14:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-291</guid>
		<description>Thanks Mark!&lt;br&gt;Something to work with... Am sure this will put me into the right direction.&lt;br&gt;&lt;br&gt;Will keep you posted</description>
		<content:encoded><![CDATA[<p>Thanks Mark!<br />Something to work with&#8230; Am sure this will put me into the right direction.</p>
<p>Will keep you posted</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mj7</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-290</link>
		<dc:creator>mj7</dc:creator>
		<pubDate>Wed, 30 Nov 2011 14:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-290</guid>
		<description>Stefan&lt;br&gt;&lt;br&gt;I may need a little more info on exactly what you are trying to achieve, however, the following information may help you. The $minWidth and $minHeight parameters set the smallest area the crop tool will allow you to shrink to when dragging the handles. The final image size is set by $img_height_main and $img_width_main. &lt;br&gt;&lt;br&gt;The other thing is the aspect ratio of the draggable crop area - this is set by editing the $cropAspectRatio variable. This is a float/integer value and can be worked out by the following equation: width/height. Therefore if you want to have an image which is 200px wide by 150px high you need to set the $cropAspectRatio to: 1.33   ( = 200/150) - the issue here is that the actual aspect ratio is 4:3 which as a decimal is 1.333333 recurring so you may get some issues with it cropping a pixel too short occasionally. To get around this you may need to either revisit your required crop aspect ratio or if you prefer you can add the following to the previewImage.php file:&lt;br&gt;&lt;br&gt;Current Line 58:   $_image-&gt;source_file = $crop;&lt;br&gt;ADD THIS:            $_image-&gt;aspectRatio = &#039;false&#039;;&lt;br&gt;Current Line 59:   $_image-&gt;newWidth = $img_width;&lt;br&gt;&lt;br&gt;As the crop tool passes almost the correct aspect ratio anyway then when the image resizes it will resize to exactly the dimensions set by $img_height_main and $img_width_main and fix any issues with the crop aspect ratio - but obviously this may cause the image to stretch by 1 pixel rather than cropping perfectly.&lt;br&gt;&lt;br&gt;Hope that is vaguely understandable!&lt;br&gt;&lt;br&gt;MJ</description>
		<content:encoded><![CDATA[<p>Stefan</p>
<p>I may need a little more info on exactly what you are trying to achieve, however, the following information may help you. The $minWidth and $minHeight parameters set the smallest area the crop tool will allow you to shrink to when dragging the handles. The final image size is set by $img_height_main and $img_width_main. </p>
<p>The other thing is the aspect ratio of the draggable crop area &#8211; this is set by editing the $cropAspectRatio variable. This is a float/integer value and can be worked out by the following equation: width/height. Therefore if you want to have an image which is 200px wide by 150px high you need to set the $cropAspectRatio to: 1.33   ( = 200/150) &#8211; the issue here is that the actual aspect ratio is 4:3 which as a decimal is 1.333333 recurring so you may get some issues with it cropping a pixel too short occasionally. To get around this you may need to either revisit your required crop aspect ratio or if you prefer you can add the following to the previewImage.php file:</p>
<p>Current Line 58:   $_image-&gt;source_file = $crop;<br />ADD THIS:            $_image-&gt;aspectRatio = &#39;false&#39;;<br />Current Line 59:   $_image-&gt;newWidth = $img_width;</p>
<p>As the crop tool passes almost the correct aspect ratio anyway then when the image resizes it will resize to exactly the dimensions set by $img_height_main and $img_width_main and fix any issues with the crop aspect ratio &#8211; but obviously this may cause the image to stretch by 1 pixel rather than cropping perfectly.</p>
<p>Hope that is vaguely understandable!</p>
<p>MJ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Conradie</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-289</link>
		<dc:creator>Stefan Conradie</dc:creator>
		<pubDate>Wed, 30 Nov 2011 13:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-289</guid>
		<description>I am not sure if I am being stupid, but I tried changing:&lt;br&gt;$minWidth            = 200;                                        // set minimum image crop width&lt;br&gt;$minHeight            = 150;                                        // set minimum image crop height&lt;br&gt;in the demo index.php file, but with no luck.&lt;br&gt;This eventually only gives me a portrait crop box and when previewing it display differently from the selected crop section.&lt;br&gt;&lt;br&gt;Please help</description>
		<content:encoded><![CDATA[<p>I am not sure if I am being stupid, but I tried changing:<br />$minWidth            = 200;                                        // set minimum image crop width<br />$minHeight            = 150;                                        // set minimum image crop height<br />in the demo index.php file, but with no luck.<br />This eventually only gives me a portrait crop box and when previewing it display differently from the selected crop section.</p>
<p>Please help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Conradie</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-288</link>
		<dc:creator>Stefan Conradie</dc:creator>
		<pubDate>Wed, 30 Nov 2011 00:45:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-288</guid>
		<description>Hi Mark...&lt;br&gt;&lt;br&gt;I am not sure what I miss but how the script is now, its cropping in portrait....&lt;br&gt;How to go about to make it crop in landscape? &lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;Stefan</description>
		<content:encoded><![CDATA[<p>Hi Mark&#8230;</p>
<p>I am not sure what I miss but how the script is now, its cropping in portrait&#8230;.<br />How to go about to make it crop in landscape? </p>
<p>Regards,<br />Stefan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mj7</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-287</link>
		<dc:creator>mj7</dc:creator>
		<pubDate>Mon, 28 Nov 2011 15:10:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-287</guid>
		<description>Stefan&lt;br&gt;&lt;br&gt;You&#039;d use it either just before you call $myImage-&gt;upload() if you want to rename the uploaded image or before $myImage-&gt;resize() if you want to rename the resized image. It should be used when processing the form which posts the image. Hope that helps.&lt;br&gt;&lt;br&gt;MJ</description>
		<content:encoded><![CDATA[<p>Stefan</p>
<p>You&#39;d use it either just before you call $myImage-&gt;upload() if you want to rename the uploaded image or before $myImage-&gt;resize() if you want to rename the resized image. It should be used when processing the form which posts the image. Hope that helps.</p>
<p>MJ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Conradie</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-286</link>
		<dc:creator>Stefan Conradie</dc:creator>
		<pubDate>Mon, 28 Nov 2011 14:43:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-286</guid>
		<description>Howzit! Mark.&lt;br&gt;&lt;br&gt;Where exactly will we use $myImage-&gt;newName = &#039;picture_id_xyx&#039;; and on what form? &lt;br&gt;Sorry if this is a stupid question&lt;br&gt;&lt;br&gt;Stefan&lt;br&gt;</description>
		<content:encoded><![CDATA[<p>Howzit! Mark.</p>
<p>Where exactly will we use $myImage-&gt;newName = &#39;picture_id_xyx&#39;; and on what form? <br />Sorry if this is a stupid question</p>
<p>Stefan</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefan Conradie</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-285</link>
		<dc:creator>Stefan Conradie</dc:creator>
		<pubDate>Fri, 25 Nov 2011 14:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-285</guid>
		<description>I will be using this in my membership pages where no SEO will be needed.&lt;br&gt;I am currently testing the system in 4 iframes on one page to make the multiple image upload.&lt;br&gt;&lt;br&gt;So far... It&#039;s working nicely.&lt;br&gt;With a bit of styling and work on the total look-ups... This system will do the trick.&lt;br&gt;&lt;br&gt;For me... This looks as the best option... For now....&lt;br&gt;Will keep you posted!</description>
		<content:encoded><![CDATA[<p>I will be using this in my membership pages where no SEO will be needed.<br />I am currently testing the system in 4 iframes on one page to make the multiple image upload.</p>
<p>So far&#8230; It&#39;s working nicely.<br />With a bit of styling and work on the total look-ups&#8230; This system will do the trick.</p>
<p>For me&#8230; This looks as the best option&#8230; For now&#8230;.<br />Will keep you posted!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mj7</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-284</link>
		<dc:creator>mj7</dc:creator>
		<pubDate>Fri, 25 Nov 2011 14:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-284</guid>
		<description>Stefan&lt;br&gt;&lt;br&gt;Uploading multiple files in a way that is both pretty and usable is always gonna throw issues - do you use iFrames or a Flash uploader or go for HTML5 and JS/Ajax - each solution is not 100% perfect.&lt;br&gt;&lt;br&gt;For me I&#039;d probably look at the HTML5 and JS route but that does heavily rely on supporting browsers so maybe the next option would be iFrames. Again it is not without it&#039;s issues but is easier to get working from scratch than Flash, is more browser friendly (at the moment) than HTML5 - so yeah, maybe your best bet.&lt;br&gt;&lt;br&gt;But, a warning - I would not build too much around iFrames usage - make it so you can easily alter how the system works in the future.</description>
		<content:encoded><![CDATA[<p>Stefan</p>
<p>Uploading multiple files in a way that is both pretty and usable is always gonna throw issues &#8211; do you use iFrames or a Flash uploader or go for HTML5 and JS/Ajax &#8211; each solution is not 100% perfect.</p>
<p>For me I&#39;d probably look at the HTML5 and JS route but that does heavily rely on supporting browsers so maybe the next option would be iFrames. Again it is not without it&#39;s issues but is easier to get working from scratch than Flash, is more browser friendly (at the moment) than HTML5 &#8211; so yeah, maybe your best bet.</p>
<p>But, a warning &#8211; I would not build too much around iFrames usage &#8211; make it so you can easily alter how the system works in the future.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mj7</title>
		<link>http://www.mjdigital.co.uk/blog/php-upload-and-resize-image-class/comment-page-3/#comment-283</link>
		<dc:creator>mj7</dc:creator>
		<pubDate>Fri, 25 Nov 2011 14:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.mjdigital.co.uk/blog/?p=176#comment-283</guid>
		<description>Thanks for this - although it would have been a much more powerful tool if you&#039;d used my PHP image class to handle the upload, resize and cropping - you could get it to do an awful lot more (especially when I release the watermark features).&lt;br&gt;&lt;br&gt;Also it looks like you are still using the old version of the webmotionuk script which means it only handles JPEGs - I feel a switch is needed - why not give my script a go!!&lt;br&gt;&lt;br&gt;But it is down to you.</description>
		<content:encoded><![CDATA[<p>Thanks for this &#8211; although it would have been a much more powerful tool if you&#39;d used my PHP image class to handle the upload, resize and cropping &#8211; you could get it to do an awful lot more (especially when I release the watermark features).</p>
<p>Also it looks like you are still using the old version of the webmotionuk script which means it only handles JPEGs &#8211; I feel a switch is needed &#8211; why not give my script a go!!</p>
<p>But it is down to you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

