Image to Post - transcode video

This commit is contained in:
Matthew Barbour 2020-10-26 10:27:26 -05:00
parent c18c7347bf
commit b4169821ed

View File

@ -111,7 +111,7 @@ class TranscodeVideo extends Extension
} }
$image_obj = Image::by_id($image_id); $image_obj = Image::by_id($image_id);
if (is_null($image_obj)) { if (is_null($image_obj)) {
$this->theme->display_error(404, "Image not found", "No image in the database has the ID #$image_id"); $this->theme->display_error(404, "Post not found", "No post in the database has the ID #$image_id");
} else { } else {
if (isset($_POST['transcode_format'])) { if (isset($_POST['transcode_format'])) {
try { try {
@ -231,7 +231,7 @@ class TranscodeVideo extends Extension
/* Move the new image into the main storage location */ /* Move the new image into the main storage location */
$target = warehouse_path(Image::IMAGE_DIR, $new_image->hash); $target = warehouse_path(Image::IMAGE_DIR, $new_image->hash);
if (!@copy($tmp_filename, $target)) { if (!@copy($tmp_filename, $target)) {
throw new VideoTranscodeException("Failed to copy new image file from temporary location ({$tmp_filename}) to archive ($target)"); throw new VideoTranscodeException("Failed to copy new post file from temporary location ({$tmp_filename}) to archive ($target)");
} }
send_event(new ImageReplaceEvent($image->id, $new_image)); send_event(new ImageReplaceEvent($image->id, $new_image));