PHP - Image Conversion With Gd
I need a little help. I am trying to convert images taken from an upload form and convert them to jpg and then upload it to my directory. I tried GD but I cant figure out how to upload the converted file. I also tried using ffmpeg to convert the file but I am only able to do it with videos, I cant find the parameters for image to image conversion. Any input would be appreciated. Thanks
Similar TutorialsHi, for my purposes, I can only use core PHP function (no PEAR for eg) to convert SQL to XML, should I convert SQL to csv first, and then use php's filesystem to read each line to extract and store as xml nodes OR does someone know easier/better method? Any help much appreciated, thanks. I need to compare current time to data based time. Time in the database is in this format > 00:00:00 Easy enough. >>>>What I need is to convert "00:00:00" format into "time();" format<<<< The opposite is below...it's all I could come up with so far. <? $gettime = time(); $displayTime = date('H:i:s', time()); echo $displayTime; ?> Thank you. I am writing a script to read a mail box and fetch mail body using php function "imap_fetchbody". If mail content encoding is UTF-8 then no problem but mail send from IPAd having ascii encoding and replace the new line with =20 along with many other changes. can anyone help me out with this in converting it to UTF-8 ?? I don't really know how to explain this, I saw once on some forum members signature, something like this : G = "\ x50 \ x72 \ 157 \ 144 \ x75 \ x63 \ 164 \ x20 \ x6c \ x69 \ 143 \ 145 \ 156 \ x73 \ 145 \ 040 \ x68 \ 141 \ x73 \ 040 \ x65 \ x78 \ 160 \. 151 \ 162 \ x65 \ 144 \ x2e \ x20 "+ E. That somehow translates into words, I know there is a PHP function to convert that, what is that code called and what is the PHP function? I've been looking at converting my php timestamps to display as month, day, and the hour and minute the event occurred on, i tried; Code: [Select] $time = date("j/n H:i", $Events['timestamp']); But no success can anyone point me in the correct direction? Thanks Hi all, Hopefully this will be a simple one for all you geniuses...Geniea... clever people out there. :? I'm trying to convert the following code from a mysql_ to sqlsrv_ statement. I have to admit i am a bit of a noob, but am learning fast! The code was originally developed by dreamweaver with some webassist extensions. $conn4 = sqlsrv_connect($hostname, $connectionInfo); if (!session_id()) session_start(); $insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1); $WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")"; $MM_editCmd = sqlsrv_query($conn4, $WA_Sql) or die(print_r( sqlsrv_errors(), true)); $_SESSION[$WA_sessionName] = sqlsrv_insert_id(); if ($WA_redirectURL != "") { if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) { $WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"]; } I appear to have had some luck with other parts of the code renaming mysql_ statements with the appropriate sqlsrv variations and some (slight) code re-hashing, but the above has given me a bit of a headache :banghead: . I assume that I need to break the "$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";" into two parts to give the sqlsrv_query it's `resource`, `array`, `parameter` format (I think that's right!), but i might be wrong. If it's all completely wrong, I apologise! Unfortunately due to the nature of the project Microsoft SQL is a necessary evil, and PDO has been considered but my brain is exploding with a (near straight) conversion as is... Unless anyone knows of a mysql to PDO conversion utility....or really easy method??? Would anyone be kind enough to help me with this? Regards Paladindc "In an ideal world, there would be no ideals, therefore would it indeed be ideal?" - Me Good evening, I hope some of you can bring me some hope to solve this problem. My client wants to create pdf files and let the user download it. He want's to design one word file and then import it to the application. After that the portal users can request it, which means that the application should take the word file, search and replace some keywords and then create the pdf file for download purposes. I see fpdf but this class only create pdf's. We can not convert from word or even search and replace in one pdf file. There is any solution that i can use bear in mind that our application is located in external servers? Looking forward for your help. Regards, HS Hello, Doing a little calendar where days are incremented as variable $i formatted like 'j' or single digit numbers 1,2,3 etc. (The calendar works fine) However for querying DB tables I need the day formatted as 'd' or 01,02,03 etc. so on any day I need to make this conversion. I can't find an easy solution though there must be one. Thanks in advance. Code: [Select] <?php //test day $i=7; $day=date('d', mktime($i)); echo "$day"; //Should be 07 ?> Hello Freaks, Is there any possible way to convert a .PDF file to .html file without using any third party app and API?. I need That conversion fully made by PHP. Because i want to have full control on that conversion Help me with your opinion.. Thank You
Can someone tell me how to convert a MySQL date such as 2010-08-13 into the the US format, such as 8/13/2010, and also the reverse using PHP? I can't seem to find the right functions. Thanks! Hi, I'm looking to create a PHP script that converts video files to MP4, WebM and OGG but I don't know where to start. I've been searching on google and on these forums for that type of information but I didn't find anything. Is there any website or PHP library/framework that I should look at in order to find that kind of information? Any help is appreciated! //$start_point = '2014-07-22'; $lastday = date('t',strtotime($start_point)); $month_val = date('n',strtotime($start_point)); echo "Last day: ". $lastday . "<br/>"; echo "Month: ". $month_val . "<br/>";I have a problem with a date value read from a MySQL database table into a PHP variable but when manipulating the vale to determine the month of the date, unexpected results appear. I am not sure what causes this but I suspect PHP is not properly handling date to string conversion. The output from the code shows 1 as the month when it should be 7. Hower the line of code with the comment "//$start_point = '2014-07-22' if added in give the correct result. When the value of the variable "start_point" is printed, it gives the value "2014-07-22". Please see the code Telly hey guys the date stored in mysql is yyyy-mm-dd i need to convert it to do a string compare i have used the following $query = "SELECT * FROM booking where id=$sel"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { $num1=$row['no_rooms']; $from1=$row['from']; $to=$row['to']; $sel1=$row['room_type']; $date = date('d-m-y', strtotime($from1)); } echo "$date"; it prints 01-01-70 can any1 tell me where is the error? thanks Hi - I have been searching for a way to select the stored time from a database (stored in 24h format - 13:20:00) and display it as 12h format. I have checked a number of forums and nothing quite seems to fit the bill. I would like it to display as 2:00pm, 12:00am, etc. Here is what I have so far: $sql = ('SELECT * FROM events WHERE active="1" AND event_date >= CURRENT_DATE AND MONTH(event_date) = 1 order by event_date ASC, event_start ASC'); $result = mysql_query($sql); $num_rows = mysql_num_rows($result); // Yes Item if (!($num_rows == 0)) { $myrow = mysql_fetch_array($result); echo ('<span class="bold" style="font-size:14px">January</span>'); do { printf ('<span>Event Time: %s', $myrow['event_start']); if ($myrow['event_end'] != '') { printf (' to %s', $myrow['event_end']); } } while ($myrow = mysql_fetch_array($result)); } Right now this just shows the regular 24h format (hh:mm:ss) for any events in the month of January. I would like both "event_start" and "event_end" to show up in 12h format. I have tried a number of things but none of it works. I'm SURE it is something simple that I have missed. Thanks in advance for any help. When pulling exif data from an image I have pretty much everythiung nailed down except for the Shutter Speed value. When pulled from the image this is returned as:- 'Shutter' => string '0.0015625' Now I know that the actual shutter speed at the time of shooting was 1/640 sec; does anyone have any ideas about how one would convert... 'Shutter' => string '0.0015625' to 1/640 sec... I have been scratching my head over this problem for a few days now and am stiull no wiser I'm pulling some info from various XML files and am having problems converting the following date format so that it can be stored as a DATETIME field in a MySQL database. Tuesday,17 August 2010 09:25:00 This obvious newbie would appreciate a shove in the right direction... Thanks in advance Hi, I am using a php script for converting avi,mpeg files to flv with ffmpeg.my code is Code: [Select] $srcFile = "uploads/flame.avi"; $destFile = "uploads/flame.flv"; $ffmpegPath = "/usr/bin/ffmpeg"; $flvtool2Path = "/usr/bin/flvtool2"; $ffmpegObj = new ffmpeg_movie($srcFile); $srcWidth = 320; $srcHeight = 240; $command = $ffmpegPath . " -i " . $srcFile . " -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile . " | " . $flvtool2Path . " -U stdin " . $destFile; $convert = exec($command); if(!$convert) { echo "FAILED!!!"; } else { echo "SUCCESS"; }I can create a flv file using this script.But sometimes it creates a flv file with size 0 k.I don't know why this is happening.With the same avi file,sometimes it creates correct flv file and sometimes flv with size 0k.How can I confirm whether the conversion is success. In both the cases it displays SUCCESS. Hi; I'm a beginner and I'm getting a big headache figuring how to convert php variables into Javascript variables. I want to use the content of $theName as the value for an input tag. $_SESSION['$Sess_Name'] is loaded with the right data, I verified it. But my function InitField returns always the word NULL. Why is that? Where is the problem? Thank Here is my code: function InitField() { <?php Hey there, I'm looking for some publicly available API that I can convert GPB to Dollars, that is updated often, can somebody show me how I could obtain such a API?. Thanks, Christopher. |