Can't create text with PHP using imagettftext [SOLVED]

I think that after the upgrade of PHP to the modular one I can't create text using TTF fonts. Before I file a bug report could someone confirm if it works or not for them? I might just have screwed something in my box.
This code should create a text image and display it in the browser (it assumes you have DejaVu fonts in the default directory):
<?php
// Set the content-type
header("Content-type: image/png");
// Create the image
$im = imagecreatetruecolor(400, 30);
// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// The text to draw
$text = 'Testing...';
// Replace path by your own font path
$font = '/usr/share/fonts/TTF/DejaVuSans.ttf';
// Add some shadow to the text
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Add the text
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Using imagepng() results in clearer text compared with imagejpeg()
imagepng($im);
imagedestroy($im);
?>
Could someone with an up to date php with GD enabled tell me if it works or him/her?
Thanks.
EDIT: Ok, I solved it. The error reporting is turned off by default now, so I was not getting any error. After turning it on I found out it was related to the open_basedir directive being enabled now in php.ini. Turning it off allowed me to access the TTF for drawing text.
Last edited by Bogart (2007-11-01 00:43:33)

Aha!  I figured it out.  I used File...Open As to open it as a Camera RAW file.  In the ACR editor, it was showing as 16-bit depth.  Changed it to 8-bit and saved it.  Now the Text tool works!
Ken

Similar Messages

  • How can I create a Online Store using Muse? (with not Business Catalyst)

    How can I create a Online Store using Muse with not Business Catalyst for example three services
    _ttps://orders.self-pub.net/checkout.php?m=fastcheckout
    _ww.self-pub.net/services/covers.html

    Hi,
    Unfortunately there is no option stand alone in Muse to create an online store. However if any hosting plan uses CMS feature like Business Catalyst and ecommerce using modules and tags, you can use the same proceedure as for Business Catalyst and integrate that system and host the Muse site on their platform and that would work.
    There is other thing that you can try is, Insert HTML codes to link the pages and some contents in Muse to your desired CMS. What you can also do is after you create the site in Muse, you can export the Muse site and get the layout and design of your site and copy paste the codes for pages with some HTML and coding skills to integrate with your desired hosting.
    Hope this helps.
    Regards,
    Rajan

  • I have adobe xi pro, but i can´t edit a form create with adobe 8.0, the message is this form can´t be edit with adobe, use adobe livecycle designer. need I to buy another program?

    I have adobe xi pro, but i can´t edit a form created with adobe 8.0. The message is: this form can´t be edit with adobe, use adobe livecycle designer. need I to buy another program?

    If the form was created using LCD then it can only be edited there. This
    application used to be bundled with Acrobat Pro, but that's no longer the
    case. So if you want to edit this file then you need to purchase it, yes.
    On Sat, Apr 4, 2015 at 6:39 PM, monicad4417911 <[email protected]>

  • How can i create messenger with java tv API on STB

    deal all.
    how can i create messenger with java tv API on STB.
    how can Xlets communicate each other?
    how?
    i am interested in xlet communications with java tv.
    is it impossible or not?
    help all..

    You can create a messenger-style application using JavaTV fairly easily. JavaTV supports standard java.net, and so any IP-based connection is pretty easy to do. The hard part of the application will be text input, but people have been using cellphone keypads to send SMS messages for long enough that they're familiar with doing this. This doesn't work well for long messages, where you really need a decent keyboard, but for short SMS-type messages it's acceptable.
    The biggest problem that you need to work around is the return channel. Many receivers only have a dial-up connection, ties up the phone line and potentially costs people money if they don't get free local calls. Always-on return channels (e.g. ADSL or cable modem) are still pretty uncommon, so it's something that you nee to think about. Of course, if you do have an always-on connection then this problem just goes away.
    This is really one of those cases that's technically do-able, but the infrastructure may not be there to give users a good experience.
    Steve.

  • Creating Text Variables to use in BEx Broadcaster

    Creating Text Variables to use in BEx Broadcaster OR How to Broadcast reports (Excel output format) and dynamically generate each Excel file name
    Hello,
    I'm new into posting to this forum, but I always come here when I need some answers and I find them almost everytime.
    But now I couldn't find a solution for my problem so I decided that maybe you can help me.
    I'm using BEx Broadcaster (I'm working on a SAP BW 7.0, SP17) to broadcast to SAP Portal some Excel files generated from a query.
    I use Filter Navigation, because the query provides me with information regarding Sales Orders from all my customers and I need to broadcast an Excel file per customer. This is working perfectly, meaning, with this query I put the Broadcaster generating an Excel file per Customer.
    The problem is that I needed that each Excel file had a different name on it.
    For example, for Customer1 the Excel file name should be something like Customer1_SalesOrder.xls, for Customer2 it should be Customer2_SalesOrder.xls and so on.
    At the present, the Broadcaster generates each Excel file using the technical name of the Query that originated the file. You can use some stardard text variables that broadcaster has available, but these standard text variables don't solve my problem. I needed to create my own Text Variables so I could have the Customer ID on the file name.
    Can someone give me a light on this?
    Points are obviously awarded.
    Thanks,
    Cristina

    Hi All,
    I have a similar requirement, where I publish my reports on to the SAP PORTAL  KM folders.
    In my broacast setting for the web templates, I have the fisrt tab called
    TARGET in PORTAL
    File Name : ReportXX MONTHLY_<MONTH_ID>  (F4) List
    Currently I use the sys variable <MONTH_ID> which gives me the curr month;
    My requirement is
    If the report is run in the first week of the month, I want to generate a filename_PREVIOUS MONTH (label) and
    if the report is run between 7th-30th of the month then to generate a filename_CURRENT MONTH (label)..
    On BI.7 POTAL is it possible using some exit variables instead of the system variable which are given in the F4 List.
    If so where do I create the exit variable in BW backend or the PORTAL itself so that I can access it from the F4list of of the filename column.
    Thanking you in advance for you time.
    Rao

  • Can't create text on this image in PSE10

    This has got me stumped.  There's something strange going on with this image.  I downloaded it from the Web, and can't create text on it -- text that's visible.  The text layer is created (I can see it in the Layers palette), but no matter what font, size or colour I use, the text does not appear on the image.  I've re-saved the file in PSE10, and as another image in PhotoPaint X5 (which can create text on the image just fine) to no avail.  Here's the image that was saved as another image in PP, but still doesn't work with the text tool in PSE10:
    It's not an important image, just one I use as a test case, but it's driving me crazy.
    Ken

    Aha!  I figured it out.  I used File...Open As to open it as a Camera RAW file.  In the ACR editor, it was showing as 16-bit depth.  Changed it to 8-bit and saved it.  Now the Text tool works!
    Ken

  • How can i create multiple accounts but use the same itunes?

    how can i create multiple accounts but use the same itunes?

    Hi iCloud is Making Me Go Crazy,
    You will need to create a new Apple ID for your GameCenter and iCloud services.  You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish. 
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Cheers,
    - Judy

  • Why can't I text with non Apple equipment?

    Why can't I text with non Apple equipment?

    You can with third party apps. You just can't use Messages in order to text since it only works with other iOS devices and Macs running Mountain Lion.
    https://www.google.com/search?q=texting%20apps%20for%20iPad

  • Why i can't create PDF with right format by LiveCycle?

    Hello,
    As we know that PDF format has four sections, the header, object body, cross-reference table and trailer.
    But after I create a PDF by Adobe LiveCycle, and open it by UltraEdit or Notepad, I cannot find the cross-reference table and some objects, “trailer” word either .
    I try to download several PDF files by follow link:
    https://my.adobeconnect.com/_a295153/p10077996/?launcher=false&fcsContent=true&pbMode=norm al ,
    and open them as the same way as before, it was the normal format I learn.
    So, why my PDF is not the right format? And how can I create PDF with right format?
    Thank you a lot!
    Ellie

    Adobe LiveCycle Designer makes XFA forms - a thin PDF wrapper around XML, no useful PDF page objects. Still, they are valid PDF. Like any PDF, you might not find a trailer or xref if a cross reference stream is used. See ISO 3200-1 7.5.8 "Cross-Reference Streams".

  • How can I create text templates on Droid Maxx?

    How can I create text templates or automatic responses on my Droid Maxx?

        @dannybedo
    I can understand the need to quickly reply to text messages without having to type the entire message.  The Motorola Droid Maxx comes with a feature called "Motorola Assist" that allows you to perform these tasks.  See more details on page 22 in the Device User Manual here: http://vz.to/1wW6P3B.
    AnthonyTa_VZW
    Follow us on Twitter @VZWSupport

  • Can you create HTML5 with Dreamweaver CS4?

    Hello.
    Can you create HTML5 with Dreamweaver CS4? Are there workarounds if not?
    I am using a PC on Windows 7.
    Thank you.

    Try copying and pasting this HTML5 code into a new, blank document.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>HTML5 Document</title>
    <!--helps older IE browsers with HTML5 tags-->
    <!--[if lt IE 9]>
    <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    </head>
    <body>
    <header>
    Header
    <h1>Site Name</h1></header>
    <nav>Navigation</nav>
    <section>
    <article>
    <h3>Article</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Mauris vitae libero lacus, vel hendrerit nisi!  Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.  Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    </article>
    <aside>
    <h3>Aside</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Mauris vitae libero lacus, vel hendrerit nisi!  Maecenas quis velit nisl, volutpat viverra felis. Vestibulum luctus mauris sed sem dapibus luctus.  Pellentesque aliquet aliquet ligula, et sagittis justo auctor varius. Quisque varius scelerisque nunc eget rhoncus.  Aenean tristique enim ut ante dignissim. </p>
    </aside>
    </section>
    <footer>Footer</footer>
    </body>
    </html>
    Nancy O.

  • Can I create books for iPhone using iBooks Author?

    Can I create books for iPhone using iBooks Author?

    There is a new $5 iBooks Creator app in iOS app store for the iPad.
    The output looked pretty good for an iPad app.
    There is a video on how to use it to give you an idea of how easy it is.
    It creates ePub 2 whihc can be read on all platforms with an ePub reader except Amazon Kindle whihc forbids such things.
    You can run the ePub through Calibre and get MOIB for Kindle which works for me.
    I have done thirty or forty conversions so far.

  • My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing.

    My Siri and microphone in other apps hasn't been working lately. I've cleaned the mics, took off te case, and it's still not working. My camera only picks up audio when it's off of vibrate. And now I can't answer texts with the new pull down thing. please help

    Hello Sarahd200037,
    Thanks for using Apple Support Communities.
    To troubleshoot the microphone on your iPhone please follow the steps in the article linked to below.
    iPhone: Microphone issues
    Take care,
    Alex H.

  • How can we create such navigation buttons using Flash CS4?

    Hi,
    How can we create such navigation buttons using Flash CS4 is in the following website? Please help me with any such tutorial to make my custom navigation bar/buttons.
    http://city.reallusion.com/join.html
    Thanks.

    While the Note 4 is a reasonably large device it still falls into the phone layout bucket. We need this layout to function on very small screens some as low as 320 pixels high and 240 pixels wide. These sorts of devices don't have the space for a full toolbar.

  • Can't create events with times between 10:01 and 19:59

    I've recently updated to OSX 10.4.9, and now can't create events with times that start with a '1'. This only seems to be a problem on the day British Summer Time begins on 25 March.
    I usually create my events in the month view, and input the start and end times by clicking in the time boxes and typing in the hours and minutes. However when I try to put in a start time of, say, 11:00, it puts in 21:00 instead. The only way around this seems to be to put in a time it will accept, like 09:00, and using the arrow keys to move it to the time I want. Or creating the events in the day view and clicking on the start time there.
    Any ideas?

    Looks like you have found a wee bug. I can replicate it. You could report it though OS X Feedback or better though ADC, but for the latter you have to register first.
    I usually create events by double-clicking in week view; often this gets the start time right, but if not then edit the start time in the info pane. Your bug is there with events created in day and week views too.
    AK

Maybe you are looking for

  • Insert 2rows in an excisting excel file

    Hi everybody, Sorry if a similar question was asked but I haven't found it. My problem is that we got a file where there are some information . And at all end of the month we will run a java application that will give us 2times 10 values that we will

  • Oracle VM 3.1 into VirtualBox how-to

    I'm trying for a testing to install latest Oracle VM release into VirtualBox. Host: VirtualBOX 4.1.16 Guests: Oracle VM Manger (3.1.1) Guests: Oracle VM Server (3.1.1) Guests: Oracle VM Server (3.1.1) Can I simulate a shared storage between the two V

  • Recorded for Outbound Processing

    Hi All, Very Good Morning. My message having large kind of payload. When i test my scenario with small kind of that data, Message successfully stored to target system database using the stored procedure, But in my real time scenario. it having large

  • Exception occurred - help me please

    Hi, I am compiling some applets from Eclipse, I arrived to my last applet and I tested it in another PC with a MSVM ver 1.1.4 after sign it with my security certificate. These applets work with Sun VM but when I open just my last applet with the vers

  • Sap.m.Table: How to disable includeItemInSelection for one column?

    Dear UI5 Experts, I have used includeItemInSelection method for whole table as it is required for me on selectionChange event in sap.m.Table control. Now, I have a requirement where I need to disable that method for one column. Is there a way to disa