When an entity is edited and saved a 2nd time, the first is neither updated or removed ending with 2 identical thumbnails in the media-library.

Comments

drzraf’s picture

This applies when 'pdfthumb_link_files' = FALSE.
But even when we left this box (remove thumbnail if pdf removed) unchecked, we probably still want thumbnail to not be recreated again and again each time a node is updated.
The {pdfthumb} should be check for pre-existing thumbnail in *any case*.
But when it comes to the removal of the original PDF, it should only be checked if the above option is activated.

drzraf’s picture

On a side note:
When you will delete the pdf file, the associated image file will be deleted
may be reformulated in the following fashion (IMHO clearer):
The associated image file created by pdfthumb will be deleted if you delete the original PDF file.

drzraf’s picture

there should always be only 1 thumbnail created for a given pdf.
That is: 1 pdffid for 1 fid. In the pdfthumb, fid should be a primary unique key.
If a record exists having a fid = the current file fid we attempt to create a thumbnail from , then we should update the file whose pdffid matches.

drzraf’s picture

StatusFileSize
new570 bytes

let's start with this schema update ?

drzraf’s picture

please note that timestamp are unusable for us as file_save() enforces the update.
so sad...

drzraf’s picture

Status: Active » Needs review
StatusFileSize
new3.29 KB

the second part.

Please note that hook_file_delete is implemented but should IMHO respect the pdfthumb_link_files option isn't ?

drzraf’s picture

Version: 7.x-1.0 » 7.x-1.1

ping ?

This module is marked:

Maintenance status: Actively maintained
Development status: Under active development

is this always the case ?