Jump to content

aNubies

Members
  • Posts

    31
  • Joined

  • Last visited

aNubies's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sir Barand, I saw a convertbmptogd function yet it won't recognize the .pix file. Do you have any other way how to read the color values of the .pix file?
  2. Okay barand, I'm gonna give it a shot. Thank you.
  3. Alright im testing the imagecreatefromstring() function, but it always give me an error saying "data is not recognized format". This is base on my previous post that what i want to do is convert my .pix file which is a map file into a jpeg file. I tried to read the stream before converting it into the function but no luck, same with file_get_contents but no luck also. Help here please. Thank you in advance.
  4. wow that's great barand, you got a very useful info there . Thank you.
  5. Well you give me a lot of references there sire , gonna check the documentation of every each and decide what could be use.
  6. Sorry for the late reply, no convertion at all, I want to do it the same with my png and jpg function which is re-scale and reduce quality only, but this time in .pix image file.
  7. Okay, now my mind is open with imagecreafrom (png, jpeg, gif) function of PHP. But i'm curious does it support other image format? ofcourse it is a very obvious question seeing those 3 are the only available function, but this is just curiosity. Since I'm planning to reduce and re-scale a sattelite image which is in ".pix" format a type of image file but with a different format. So is it possible? Those who work in maps, satellites is very much appreciated or anyone . Thank you very much in advance.
  8. well, thank you haku for the info, you've anwer my question since i have a feeling that seeing my source code, javascript seems unable to call the php second time around. Thank you again haku.
  9. Here's my current code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title> Reduce & Resize Images </title> <?php function CheckDirectory() { $netDir = "Network_Images/*.png"; $locDir = "Local_Images/"; foreach (glob($netDir) as $net) { $files = glob($locDir."/".substr($net, strpos($net, "/") + 1)); if (empty($files)) { $im = imagecreatefrompng($net); $new_image = imagecreatetruecolor(50, 50); imagecopyresampled($new_image, $im, 0, 0, 0, 0, 50, 50, imagesx($im), imagesy($im)); $im = $new_image; imagepng($im, $locDir.substr($net, strpos($net, "/") + 1), 0); } } } ?> <script type="text/javascript"> function init() { console.log("timeout called"); document.write("<?php CheckDirectory(); ?>"); t = setTimeout(function() {init()}, 30000); } </script> </head> <body onload="init()"> <form action="" method="POST" enctype="multipart/form-data"> <label name="lblBrowser">Filename : </label> <input type="file" name="fileUpload" id="fileUpload" /><br /> <input type="submit" value="Upload" id="Upload" /> </form> </body> </html>
  10. Yeah I recently use the format that you've given to me Sir Haku, however; the console says CheckDirectory is not defined and it doesn't execute at all.
  11. Okay after observing something in console and page source, looks like the reason is that after executing it once the source turns into this <document.write("");> at first <document.write("phpcode");> and it turns into nothing. Is it saying that javascript cannot run server side code, but instead use AJAX? Anyone please help me out here.
  12. Sorry, never knew about console.log, but anyway, i just tested it and it says CheckDirectory not defined. So i place it back in php tag and re-run it, and it works fine however only once not with the desire every 30secs count.
  13. Thank you for the response, but it doesn't work.
  14. removing the exit(); doesn't make any changes, still it execute once.
  15. Nope not yet, the code above just executed once, thinking of my code it should be execute every base time set in setTimeout(), but it didn't.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.