|
|
| New Topic Reply Subscription Options |
|
| Forums: ImageCFC Forum: addText bug? | |||
|
|||
| abram
Joined: 02/06/07 Posts: 7 |
addText bug? Posted Friday, May 25, 2007 at {ts '2013-05-24 20:55:00'} I've been using imageCFC for a little while now and just discovered a problem with the addText function. When called, the function creates a temporary file like "/tmp/+~JF36628.tmp" (on Linux) but it does not clean up when it is finished. So if you don't manually delete the files in the /tmp/ directory you'll eventually run out of space. I found this out with a site that I'm working on that creates images with 30-50 captions (addText). So for each image that was created, 30-50 temporary files were created. It took about a day to run out of space on my dev server. Any suggestions? |
||
|
|||
| admin
Location: Apex, NC Posts: 193 |
RE: addText bug? Posted Friday, May 25, 2007 at {ts '2013-05-24 22:02:00'} It's not actually a bug, it's something that java does, and I find it to be rather obnoxious. I guess I never mentioned it, but I use imageCFC for captcha generation and I had the same problem. MY solution was a cron job that looks like this:
This deletes all of those tmp files more than 2 minutes old. Rick Root
|
||
|
|||
| abram
Joined: 02/06/07 Posts: 7 |
RE: addText bug? Posted Tuesday, May 29, 2007 at {ts '2013-05-24 13:14:00'} bummer. That's what I was doing, but it seems there must be a better way. It would be self destructive for Java to have such annoying features. I'll keep looking and post back if I find anything. |
||
|
|||
| abram
Joined: 02/06/07 Posts: 7 |
RE: addText bug? Posted Tuesday, May 29, 2007 at {ts '2013-05-24 20:13:00'} Update: For those who care, I did find a semi-solution to this problem. The createFont method of java.awt.Font takes an InputStream (java.io.FileInputStream) as the file with the font attributes (ttf file). The method creates a temporary file as a connection to the FileInputStream but does not release it, even if you call the close method. To work around this I use the generic fonts instead of loading the ttf font file. So Instead of this in the addText function: font_stream.init(fontDetails.fontFile); I use: font.init('serif',evaluate(fontDetails.style),fontDetails.size);This is "supposed" to also work with any installed system font on the server but I have not been able to get it to do so. For my purpose, sansserif works fine. I also played with using cffile to readbinary the ttf file and passing that variable to a java.io.ByteArrayInputStream but it ends up the same. If any java gurus out there know a better solution please advise. |
||
|
|||
| admin
Location: Apex, NC Posts: 193 |
RE: addText bug? Posted Thursday, May 31, 2007 at {ts '2013-05-24 11:40:00'} BTW, ImageCFC now has this functionality built in as an option. The FontDetails struct can now contain EITHER the fontFile key *OR* the fontName and style keys (I made an assumption based on the java docs that your "evaluate(fontDetails.style)" takes "font.PLAIN" "font.BOLD" or "font.ITALIC") That's in ImageCFC 2.16 http://www.opensourcecf.com/imagecfc/download.cfm Rick Root
|
||
|
|||
| japablaz
Joined: 05/25/07 Posts: 3 |
RE: addText bug? Posted Wednesday, July 11, 2007 at {ts '2013-05-24 21:56:00'} Sure, the platform is BlueDragon Server JX 6,2,1,302 running on a Linux server. i'm not getting a "cannot connect to X11 server" and "This graphics environment can be used only in the software emulation mode", but i think the issue is related to the ClassNotFound exception. With regard of addText note, I have no access to /tmp folder since I'm just a web developer Thanks for your help again. |
||
|
|||
| admin
Location: Apex, NC Posts: 193 |
RE: addText bug? Posted Wednesday, July 11, 2007 at {ts '2013-05-24 22:28:00'} The /tmp folder is usually publically accessible.. however, I guess I'm confused. Did I send you to this thread? This really only applies to people who successfully are able to add text to images.... From your other thread, I thought you weren't able to do anything. Rick Root
|
||
|
|||
| japablaz
Joined: 05/25/07 Posts: 3 |
RE: addText bug? Posted Thursday, July 12, 2007 at {ts '2013-05-24 15:05:00'} oopsss wrong thread. sorry |
||
|
|||
| aidema
Joined: 08/21/08 Posts: 8 |
RE: addText bug? Posted Saturday, November 22, 2008 at {ts '2013-05-24 09:35:00'} So is this bug fixed or not? I want to setup this functionality as a captcha script but also don't want to have to go clean up the extra files. |
||
|
|||
| New Topic Reply Subscription Options |
|
| Subscription Options |
| Subscription options are available after you log in. |
There are 24 active user sessions right now.