Jump to content

kirkh34

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by kirkh34

  1. hello all, i have a function to copy a png 24 while preserving transparency and recolor the image and save a new file. the color works but the image edges become fuzzy. i'm not entirely sure what is causing this. i'd like to have the same quality as the original image with clean edges. love to hear suggestions. thanks a lot <?php function color_png($src_string, $directory, $r, $g, $B){ $im = imagecreatefrompng($src_string); imageantialias($im, true); $width = imagesx($im); $height = imagesy($im); $imn = imagecreatetruecolor($width, $height); imagealphablending($imn,false); $col=imagecolorallocatealpha($imn,255,255,255,127); imagesavealpha($imn,true); imagefilledrectangle($imn,0,0,$width,$height,$col); imagealphablending($imn,true); imagecopy($imn, $im, 0, 0, 0, 0, $width, $height); imagefilter($imn, IMG_FILTER_NEGATE); imagefilter($imn, IMG_FILTER_COLORIZE, $r, $g, $B); imagepng($imn, $directory); imagedestroy($imn); } ?>
  2. I'm confused at what you mean? run one query at the start of what? I need the title_id in the array. I must use that loop?
  3. thank you for your replies. I understand that it is wrong to run queries in loops, but I am not sure how I would complete it otherwise? I have to run that foreach loop in order to get the title_id needed to run the query. Can you explain a different structure that would work for what I need?
  4. Hello. I have a table title_views with each row being a "view" with a user_id, title_id, prog_id, date, and id. I want to gather just the user_ids without it returning duplicate user_ids. Right now I'm receiving duplicate user_id. Any help is appreciated. Thank you. <?PHP include("db.php"); $qry= mysql_query("SELECT * FROM programs") or die (mysql_error()); while($row = mysql_fetch_array($qry)){ $prog_titles = $row['titles']; $prog_titles = explode(',' , $prog_titles); $prog_id = $row['prog_id']; array_shift($prog_titles); foreach($prog_titles as $prog_title){ $trimmed = trim($prog_title); $qry= mysql_query("SELECT DISTINCT user_id FROM title_views WHERE title_id = '$trimmed' and prog_id = '$prog_id' ") or die(mysql_error()); $row = mysql_fetch_array($qry); echo $row['user_id'] . "<br />"; } // end foreach } //end while ?>
  5. I'm trying to find a good function that allows me to resize an image and specify the paths, the dimensions, and the quality about the image. Does anyone have any suggestions? Thanks
  6. how dumb of me!! see what happens when you don't code for a few months... that's easy! thanks a lot i feel really dumb but i appreciate the quick response! i still don't understand why it hangs up...oh well the problem is fixed
  7. I've been getting this error: Fatal error: Maximum execution time of 30 seconds exceeded in... (gives file and line number) I've cut out most of the code in the for loop to narrow it down specifically to the $i variable messing it up somehow... The 2nd part of the if statement where I try to append the $i variable to the new $row_ variable is causing it to hang like this. I want to be able to make 5 new variables... $row_1...$row_2...etc... but for some reason when I try to append the $i to it, it hangs. and throws that error eventually. Does anyone know why it does this? Any help is appreciated. Thank you! for ($i=1;$i<6;$i++){ if ($row['bef_remarks' . $i] != "Description"){ $row_.$i = 1;
×
×
  • 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.