The function call above evaluates to false if wp_attachment_is_image($attachment_id) evaluates to false (see why in the WordPress reference). So in particular when dealing with PDF attachments wp_get_original_image_path($attachment_id, ...) always evaluates to false and in turn triggers the regenerate_thumbnails_regenerator_file_not_found error with the message above.
I would suggest to use get_attached_file( $this->attachment->ID ) as the fullsizepath when we are not dealing with an image attachment. This way PDF attachment thumbnails get regenerated as intended.
When I try to regenerate the thumbnails of a PDF attachment I receive the following error message:
The error message is misleading as there is no issue with the fullsize attachment file.
https://github.com/Automattic/regenerate-thumbnails/blob/5a8b4317f233337a7bb6a50bdc3c3f55b63bdfe2/includes/class-regeneratethumbnails-regenerator.php#L131
The function call above evaluates to
false
ifwp_attachment_is_image($attachment_id)
evaluates tofalse
(see why in the WordPress reference). So in particular when dealing with PDF attachmentswp_get_original_image_path($attachment_id, ...)
always evaluates tofalse
and in turn triggers theregenerate_thumbnails_regenerator_file_not_found
error with the message above.I would suggest to use
get_attached_file( $this->attachment->ID )
as thefullsizepath
when we are not dealing with an image attachment. This way PDF attachment thumbnails get regenerated as intended.This issue has already been raised in #94.