Jump to content

Thomisback

Members
  • Posts

    140
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Thomisback's Achievements

Member

Member (2/5)

0

Reputation

  1. Dear all, I'm trying to make a script that posts our company its products to a website, I have got everything working apart from 1 detail, which I hope you guys could help me with. I'd like to add pictures so there's an image upload page but the ID of the uploaded image is retrieved using a javascript code and I cannot figure out howto retrieve that in PHP/CURL, perhaps any of you could help me? The website is: http://verkopen.marktplaats.nl/select_category.php Just select the 2 first values from the 2 drop down boxes and enter a random e-mail address to get to the image upload. You'll find 3 Browse buttons, and if you look into the source there are 3 according fields: <input type="hidden" id="uploadedFileIds_0" name="uploadedFileIds[0]" value="" /> <input type="hidden" id="uploadedFileIds_1" name="uploadedFileIds[1]" value="" /> <input type="hidden" id="uploadedFileIds_2" name="uploadedFileIds[2]" value="" /> They're hidden but become populated as soon as an image has been uploaded, I'm almost certain this is done using Javascript and I can't simulate that with PHP/CURL so I'm trying to find a way to do it... I'm desperate for help so thought I'd ask some clever people? Thanks a lot!
  2. Hi, I have made a small PHP script, the problem is that after I run it the array is still empty. But if I print_r the array inside the function it does work and prints one value. <?php function test_function($parameter){ $thiz[] = "testvalue"; return(1); } $thiz = array(); $this_array = array(); $this_array[] = "value1"; $this_array[] = "value2"; foreach ($this_array as $parameter){ test_function($parameter); } print_r($thiz); ?> Kind regards
  3. Hi, What I'm trying to do is: - Extract numbers from an image and save them into separate files, coordinates of where the image has to be cut (vertically) are known - Background is always white - Numbers are always black E.g. I want to cut my image vertically at X-coordinates 5 and 10, how would I do this? Would you suggest to use ImageMagick or just opening the image using a handler? Thanks for your time, Kind regards
  4. Hi, I have a very complex image editing problem, I've been trying to get this to work for 2 days now so I decided to post it over here. What I'm trying to do is: - Extract numbers from an image and save them into separate files, coordinates of where the image has to be cut are known - Background is always white - Numbers are always black An array contains the X-values where the image has to be cut: Array ( [0] => 8 [1] => 18 [2] => 40 [3] => 45 [4] => 55 [5] => 83 [6] => 92 [7] => 113 [8] => 120 [9] => 130 ) Now I tried to cut the image using this code: $filename = 'image.jpg'; // Resample $image_p = imagecreatetruecolor(($lines[0]), $totalY); $image = imagecreatefromjpeg($filename); imagecopyresampled($image_p, $image, 0, 0, 0, 0, $x, $y, $x, $y); // Output imagejpeg($image_p,"1.jpg",100); exec("convert 1.jpg -fuzz 2% -trim 1.jpg"); $white = imagecolorallocate($image, 255, 255, 255); for($xx = 0; $xx <= $lines[0]; $xx++){ for($yy = 0; $yy <= imagesy($image); $yy++){ $currentCount++; imagesetpixel($image, round($xx),round($yy), $white); // echo "X = $x and Y = $y<br>"; } } imagejpeg($image, 'image.jpg', 100); // exec("convert image.jpg -fuzz 2% -trim image.jpg"); //trim border down $lines = array_slice($lines, 1); $lines represents an array containing all the X-coordinates. The code I tried above is very buggy and isn't reliable, does anyone know a way to do this which would be better? Kind regards, your help is appreciated.
  5. The values in the array are sorted from small to big so that shouldn't be a problem
  6. Haha thanks I just tried it, the array in your example: $array = array(1,3,7,12,13,14); Should return something like: $array = array(1,3,4,7,12,14); But gives me: Array ( [0] => 1 [1] => 3 [2] => 7 [3] => 12 ) Any help? Never mind I think it works Let me try that again XD
  7. There will never be recurring numbers so no need to worry about that. All of the values in the array will be numeric.
  8. Oh my bad, No I was just showing that it should leave one of the numbers of the consecutive numbers instead of deleting all of them.
  9. Hi, I'm having a really interesting problem, after searching for some time I decided to post it here. For example if I have an array like this: //Creates an array with elements. $theVariable = array("1", "5", "8", "15", "16", "17", "23", "44", "45"); How would I change it so there are no more consecutive numbers? Like this: //Creates an array with elements. $theVariable = array("1", "5", "8", "16", "23", "44"); Suggestions are welcome... Kind regards
×
×
  • 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.