Facepalm to myself. I need a weed I think. My head is too heavy to understand thing. So, if I copy and paste the script in another page then INCLUDE the page to the one, will it work?
Nope, you can never include it in. It is an image, you can only use the output as an image such as in a <img> tag.
Or perhaps, it has nothing to do with the header but to the src of the image. I tries ob_start, flush, end flush etc, but in vain. In fact, all other websites I saw, they are doing the same as me and they are not getting errors. Do you think it has something to do with the src of the img tag?
Or perhaps, it has nothing to do with the header but to the src of the image. I tries ob_start, flush, end flush etc, but in vain. In fact, all other websites I saw, they are doing the same as me and they are not getting errors. Do you think it has something to do with the src of the img tag?
The current source of your image tag is an .jpg indicating it is not this script. That image is already corrupt. You can point it at your script if you want, but if you are doing something like a watermark, I'd suggest it is much more efficient to write once and store the image than constantly writing the watermark. GD has a lot of overhead in it, so use it sparingly. If the data is supposed to be dyanmic (like, a barcode) then it makes sense to use the GD to build that at runtime.
This sucks. Wait, suppose I have an image on the page. I have a textbox below, and a user write some texts and press OK, the forms goes to another page, and output the text on the image which was the same on the page the user wrote the text, we cannot?
Guys, can you help me on a last thing? Its not about issue but want to know something. Its better i ask to avoid losing time to try it.
Last edited by Inigoesdr; 12-01-2012 at 12:17 AM..
At least post the image somewhere and let us play with it.
Describe what text needs to be added (font ,size and color).
It's easy to show a working example.
I have tried y maximum to figure out how these websites are writing texts online on images but in vain. I thought it was HTML5 Canvas, but unfortunately, you cannot do that as if you want to edit a text, you have to reset the whole canvas. I switched to PHP GD, again the same thing, there is no multiline functionality either.
// The hardest part will be to get the actual width of the text (in pixels).
// This will be used to determine the position and margins.
// In this example, I am not doing any math ... just using fixed positions.
// But this is the way to get the text width
// $b1 = imagettfbbox($fontSize, 0, $font, $bfirst);
// Then, instead of 95, you would do some math using $b1.
I did a card, but I abandoned when the multiline function does not work. Moreover, when you edit a textbox, or even remove a value, then click submit, it does not update the card. I mean on your example. This is why I lost courage earlier.