I have this image:
Between the text, I want to add some text. To do that I have the following code:
<?php
error_reporting(E_ALL);
$thumb_src = 'copyright-symbol.png';
$explode = explode('.', $thumb_src);
$extension = strtolower( end ( $explode ) );
$file_name = basename( $thumb_src );
//image_resize_base_width( $relative_url, $relative_url, 350, $extension);
$jpg_image = imagecreatefrompng( $thumb_src );
// set font size
$font = @imageloadfont($jpg_image);
$fontSize = imagefontwidth($font);
$orig_width = imagesx($jpg_image);
$orig_height = imagesy($jpg_image);
// Create your canvas containing both image and text
$canvas = imagecreatetruecolor( $orig_width, ($orig_height + 40 ) );
// Allocate A Color For The background
$bcolor = imagecolorallocate( $canvas, 255, 255, 255 );
// Add background colour into the canvas
imagefilledrectangle( $canvas, 0, 0, $orig_width, ($orig_height + 40), $bcolor );
// Save image to the new canvas
imagecopyresampled( $canvas, $jpg_image, 0, 0, 0, 0, $orig_width, $orig_height, $orig_width, $orig_height );
$font_path = 'font/arial.ttf';
$path = 'upload';
$text = 'cc-by-nd-';
// Allocate A Color For The Text
$color = imagecolorallocate($canvas, 0, 0, 0);
// Print Text On Image
imagettftext( $canvas, 13, 0, 0, $orig_height + 25, $color, $font_path, $text) ;
// Send Image to Browser
imagepng( $canvas, $path . '/' . $file_name );
// Clear Memory
imagedestroy($canvas);
But the code is not adding text to the image. Is there anything wrong in my code?

@from$font = @imageloadfont($jpg_image);. Looks like you're loading an image as font, is$jpg_imagea bitmap font?var_dump($jpg_image)is returnresource(3) of type (gd).