Jump to content


  • Posts

  • Joined

  • Last visited

HungryMind's Achievements


Member (2/7)



  1. I tried another method: resize.php header('Content-Type: image/png');$filename = $_GET['filename'];$w = $_GET['w'];$h = $_GET['h'];list($width, $height) = getimagesize($filename);$new_width = $w;$new_height = $h;$image = imagecreatefrompng($filename);$image_p = imagecreatetruecolor($w,$h);imagealphablending($image_p, false);imagesavealpha($image_p, true);imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);imagepng($image_p);imagedestroy($image);imagedestroy($image_p); but when i'm passing *.php through file_get_contents It's giving me warning: Warning: file_get_contents(resize.php?filename=1.png&w=50&h=50) [function.file-get-contents]: failed to open stream: No such file or directory in C:Program Fileswampwwwprojectajax.php on line 13 function resizeImage($filename){ $ret = base64_encode(file_get_contents($filename)); This is line no. 13 return $ret;}echo resizeImage('resize.php?filename=1.png&w=50&h=50');
  2. Hi Guys, I'm resizing an image with "imagecopyresampled". But i want base64_encode data in return without creating TEM file. function resizeImage($filename, $new_path, $w, $h){ list($width, $height) = getimagesize($filename); $new_width = $w; $new_height = $h; $image = imagecreatefrompng($filename); $image_p = imagecreatetruecolor($w,$h); imagealphablending($image_p, false); imagesavealpha($image_p, true); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height); imagepng($image_p, $new_path); imagedestroy($image); imagedestroy($image_p); $ret = base64_encode(file_get_contents($new_path)); return $ret;} In this code, i'm creating a TEMP file. But this method is too heavy for me. imagepng($image_p, 'I DONT WANT to CREATE any TEMP FILE'); I tried ob_get_content examples, but i failed :/ Please guide. Specially waiting replies from my ever loving teachers: thescientist & justsomeguy
  3. OMG You are really awesome boss Yes! you are right. We need to rotate 90 degree when i get orientation case 8 Wow! i'm really happy I'll implement this tomorrow then i'll reply you back with sample Thank you sooo much sir
  4. hi sir, thanks for suggestion. i tried php_exif but still getting same issue please check attached image.
  5. But sir i want to do it with php. It's a part of my watermark script tool. Anyone can upload any dimensional image then my script will detect images by their dimention and it will apply landscape watermark image to landscape images and portrait watermark image to portrait images.
  6. Yes sir, if i'm creating a new file. It works perfect. But when i'm using my camera images! only portrait images have an issues. I've uploaded my files. It's too simple sample files. You can test by yourself. I hope you will enjoy this funny thing Please download my camera images: http://www.muhammadsameer.com/projects/php_getimagesize/watermarks.rar
  7. Thanks for reply sir Both images are displaying correctly. the landscape one is showing as landscape and portrait one is showing as portrait. Please Check This Attached Image:
  8. Try to remove ^ from start and $ from end and then test code again.
  9. Hi, I'm facing some php funny issues while im getting image sizes from php. Please check uploaded "IMAGE" file. I've described in detail everything there. These are my codes: Javascript getimagesize sample code: <html><body><script>// landscapevar l = new Image();l.onload = function(){ alert('landscape: width ( ' + this.width + 'px ), height ( ' + this.height + 'px )');}l.src = 'landscape.jpg';// portraitvar p = new Image();p.onload = function(){ alert('portrait: width ( ' + this.width + 'px ), height ( ' + this.height + 'px )');}p.src = 'portrait.jpg';</script></body></html> PHP getimagesize sample code: <?phplist($wl, $hl) = getimagesize('landscape.jpg');list($wp, $hp) = getimagesize('portrait.jpg');print "<p>landscape: width( " . $wl . "px ), ( " . $hl . "px )</p>";print "<p>portrait: width( " . $wp . "px ), ( " . $hp . "px )</p>";?> Please guide me. Mr. "JustSomeGuy", Mr. "Boen_Robot", Mr. "Scientist". You guys are my old teachers Please find attached.
  10. @Deirdre's Dad, @thescientistYou both are my old teachers. Please guide me to make simplest script for JQuery Sliders for new users.
  11. Hi Guys,This is the link of my code preview:http://www.muhammads.../simple-slider/Everything is working perfect. But when i'm using code for auto slide.On Click Left & Right Button, My slider slides lately.I don't recognize why.This is the simple code.Please guide me friends. <script>var cnt = 0;var track = 3;var setLeft = '';$(document).ready(function(){var canvas = $('div.canvas');var canvasWidth = canvas.width();var slides = canvas.find('ol.slides');var slidesWidth = slides.width();var single = slides.find('li');var singleWidth = single.width();var active = parseInt(canvasWidth/singleWidth);var slidesSize = single.size();var slidesCount = parseInt(slidesSize-active);var singleSlide = parseInt(single.width());var setDelay = 2000; // 1Second x 1000var reSlide = track; // 1Second x 1 $('a.left').click(function(){ track = 0; if(cnt != 0) { slides.animate({left: '+=' + singleSlide}); cnt--; }}); $('a.right').click(function(){ track = 0; if(cnt < slidesCount) { slides.animate({left: '-=' + singleSlide}); cnt++; }}); setInterval(function(){ if (track == reSlide) { if(cnt != slidesCount) { cnt++; setLeft = '-=' + singleSlide; } else { track = reSlide; cnt = 0; setLeft = '+=' + (slidesWidth-canvasWidth); } slides.delay(setDelay).animate({left: setLeft}); } else { track++; }}, setDelay);});</script>
  12. I want to get data which is under these codes <!--load_css--> and <!--/load_css--> using preg_match() <!--load_css--><link href="../styles/style.css" rel="stylesheet" type="text/css" /><link href="../styles/style_ii.css" type="text/css" rel="alternate stylesheet" title="b-bg"/><link href="../styles/style_iii.css" type="text/css" rel="alternate stylesheet" title="c-bg"/><link href="../styles/style_iv.css" type="text/css" rel="alternate stylesheet" title="d-bg"/><link href="../styles/style_v.css" type="text/css" rel="alternate stylesheet" title="e-bg"/><link href="../styles/style_vi.css" type="text/css" rel="alternate stylesheet" title="f-bg"/><link href="../styles/style_vii.css" type="text/css" rel="alternate stylesheet" title="g-bg"/><link href="../styles/style_viii.css" type="text/css" rel="alternate stylesheet" title="h-bg"/><!--/load_css--> Need help please.Specially waiting for: the scientist, boen robot, justsomeguy replies.
  13. My client has purchased SSL.But I am confused that how to embed SSL in my PHP checkout page.Please guide.
  14. Hi, I've this query select id=>ID, name=>Name/h, icon=>My Picture/img, link=>Link/a, active=>Action from es_socialmedia where del='no' order by id desc limit 0,20 I just want to remove these: =>ID=>Name/h=>icon=>My Picture/img=>Link/a=>Action I'm using this preg_replace() preg_replace("@=>[a-zA-Z_(\/(.?))]*@", "", $sql); It's working perfect. But! when i'm using space between "My Picture/img"Then i'm getting error.I tried (\s) too, But it's not working :SIf i'm using "My_Picture/img" with underscore. It works perfect.Plz could anyone refine this sql query for me?Help will be appreciated.
  15. Hi, I want to re-structure my mysql table. mysql_query("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT, category_a VARCHAR(30))") or die(mysql_error()); Now! i want to add another fields in this table structure.If admin want to create field category_b and category_c.Should i change table structure and add required fields.Or i should have to redesign database structure.So is it a good way?Like:table: testfields: user_id, categoriesfield values: category afield values: category bfield values: category cI want this type of result.userid: 1, category: auserid: 1, category: buserid: 1, category: cit'll possible in 3 rowsI was trying.userid: 1, category_a: a, category_b: b, category_c: c // It's possible in one rowPlease guide.
  • Create New...