function pdf_to_imagefield_save_image in PDF to ImageField 6
Save created image to files table.
1 call to pdf_to_imagefield_save_image()
- pdf_to_imagefield_convert_pages in ./
pdf_to_imagefield.module - Convert pages from pdf file to ImageField files
File
- ./
pdf_to_imagefield.module, line 133 - PDF to ImageField core hooks and menu callbacks.
Code
function pdf_to_imagefield_save_image($filename, $path) {
$image = new stdClass();
$image->filename = $filename;
$image->filepath = $path . '/' . $filename;
$image->filemime = file_get_mimetype($image->filepath);
$image->filesize = filesize($image->filepath);
$image->status = 1;
$image->timestamp = time();
$image->uid = 1;
drupal_write_record('files', $image);
return $image;
}