<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Question2Answer Q&amp;A - Recent questions tagged png</title>
<link>https://www.question2answer.org/qa/tag/png</link>
<description>Powered by Question2Answer</description>
<item>
<title>How i can add after all blob image .jpg or .png</title>
<link>https://www.question2answer.org/qa/43154/how-i-can-add-after-all-blob-image-jpg-or-png</link>
<description>How i can add after all blob image .jpg or .png &lt;br /&gt;
&lt;br /&gt;
Now i load image link &lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723&quot; rel=&quot;nofollow&quot;&gt;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
How i load all image add .jpg or .png&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723.jpg&quot; rel=&quot;nofollow&quot;&gt;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723.png&quot; rel=&quot;nofollow&quot;&gt;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=558964680035738723.png&lt;/a&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/43154/how-i-can-add-after-all-blob-image-jpg-or-png</guid>
<pubDate>Fri, 23 Jan 2015 07:55:39 +0000</pubDate>
</item>
<item>
<title>Why is function qa_image_constrain_data() returning a JPEG? [solved]</title>
<link>https://www.question2answer.org/qa/28874/function-qa_image_constrain_data-returning-jpeg-solved</link>
<description>

&lt;p&gt;
	&lt;span style=&quot;color:#ff0000;&quot;&gt;Question closed! → Just 15 min later I realized that the JPG format is only used &lt;strong&gt;when resizing!&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	This way I have implemented it in my old plugin as well :) good work gidgreen!&lt;/p&gt;


&lt;p&gt;
	&lt;span style=&quot;text-decoration: line-through;&quot;&gt;I disagree with the solution of always throwing back a JPEG.&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	With PNG you can save a lot of data and compress much better if it is an appropriate image. E.g. make a screenshot, you will notice PNG is much better in compressing it. Jpeg is better for real life photos.&lt;/p&gt;


&lt;p&gt;
	I suggest changing the: &lt;strong&gt;function qa_image_constrain_data($imagedata, &amp;amp;$width, &amp;amp;$height, $maxwidth, $maxheight=null)&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	so that it returns a PNG image if the image uploaded was PNG. Code example:&lt;/p&gt;


&lt;p&gt;
	$src = imagecreatefrompng($file['tmp_name']);&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // create new image
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;$newImage = imagecreatetruecolor($newwidth,$newheight);&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // do the image resizing by copying from the original into $newImage image
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;imagecopyresampled($newImage,$src,0,0,0,0,$newwidth,$newheight,$width,$height);&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // write image to buffer and save in variable
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ob_start(); // stdout --&amp;gt; buffer
&lt;br&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; imagejpeg($newImage,NULL,90); // do JPG instead of PNG
&lt;br&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color:#0000ff;&quot;&gt;$newImageToSave&lt;/span&gt; = ob_get_contents(); // store stdout in $newImageToSave
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ob_end_clean(); // clear buffer&lt;/p&gt;


&lt;p&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; // remove images from php buffer
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;imagedestroy($src);
&lt;br&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;imagedestroy($newImage);
&lt;br&gt;
	&amp;nbsp;&lt;/p&gt;


&lt;p&gt;
	$blobid=qa_db_blob_create(&lt;span style=&quot;color:#0000ff;&quot;&gt;$newImageToSave&lt;/span&gt;, $extension, @$file['name'], $userid, $cookieid, qa_remote_ip_address()); // v1.5.4&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/28874/function-qa_image_constrain_data-returning-jpeg-solved</guid>
<pubDate>Wed, 06 Nov 2013 04:08:03 +0000</pubDate>
</item>
<item>
<title>About PNG image created in qa_blob table</title>
<link>https://www.question2answer.org/qa/23576/about-png-image-created-in-qa_blob-table</link>
<description>I would like to process rounded corners avatar image(Alfa-channel PNG). The PNG registered into qa_blob table is displayed by JPEG. Is it difficult to display according to PNG format?</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/23576/about-png-image-created-in-qa_blob-table</guid>
<pubDate>Wed, 01 May 2013 04:51:15 +0000</pubDate>
</item>
<item>
<title>Avatars are converted to JPEG</title>
<link>https://www.question2answer.org/qa/19517/avatars-are-converted-to-jpeg</link>
<description>I cannot understand why all uploaded PNG avatars are converted to JPEG??? For what? The images loos ther transparency. Please make support of PNG avatars.</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/19517/avatars-are-converted-to-jpeg</guid>
<pubDate>Wed, 28 Nov 2012 01:47:35 +0000</pubDate>
</item>
<item>
<title>Why does q2a outputs BMP image instead of PNG image? Bug?</title>
<link>https://www.question2answer.org/qa/18727/why-does-q2a-outputs-bmp-image-instead-of-png-image-bug</link>
<description>

&lt;p&gt;
	&lt;span style=&quot;color:#000000;&quot;&gt;I checked qa_blobs table and see that the uploaded images are in file format PNG. However, q2a displays them as BMP? Is this a bug?&lt;/span&gt;&lt;/p&gt;


&lt;p&gt;
	Check this example graphic, if you save it, it has extension BMP and is quite big:&lt;/p&gt;


&lt;p&gt;
	&lt;img alt=&quot;&quot; src=&quot;http://www.question2answer.org/qa/?qa=blob&amp;amp;qa_blobid=596232564897490653&quot;&gt;&lt;/p&gt;


&lt;p&gt;
	However, it was uploaded as PNG!&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/18727/why-does-q2a-outputs-bmp-image-instead-of-png-image-bug</guid>
<pubDate>Mon, 29 Oct 2012 07:30:27 +0000</pubDate>
</item>
<item>
<title>Can we convert uploaded BMP images to PNG? + Bug?</title>
<link>https://www.question2answer.org/qa/18726/can-we-convert-uploaded-bmp-images-to-png-bug</link>
<description>

&lt;p&gt;
	I just realized that some of my users start uploading BMP files that are quite big (up to 1 MB).
&lt;br&gt;
	
&lt;br&gt;
	Is there any option to convert uploaded BMP images to PNG?&lt;/p&gt;


&lt;p&gt;
	-- EDIT:
&lt;br&gt;
	Absolutely weird, I download the file that was uploaded by one of my users. Now I try to upload it here and in my forum as well. Both give me the error notice:&lt;/p&gt;


&lt;p&gt;
	&lt;strong&gt;The image could not be read. Please upload one of: GIF, JPG, PNG&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;
	So how was my user able to upload the image?&lt;/p&gt;


&lt;p&gt;
	&lt;span style=&quot;color:#000000;&quot;&gt;-- UPDATE:
&lt;br&gt;
	I checked qa_blobs table and see that the uploaded images are in file format PNG. However, q2a displays them as BMP? Is this a bug?&lt;/span&gt;&lt;/p&gt;</description>
<category>Q2A Core</category>
<guid isPermaLink="true">https://www.question2answer.org/qa/18726/can-we-convert-uploaded-bmp-images-to-png-bug</guid>
<pubDate>Mon, 29 Oct 2012 07:14:14 +0000</pubDate>
</item>
</channel>
</rss>