Hi,

I am using migrate to import pdf files as atoms.
It works well except that the thumbnail is not generated.
The problem is that when the atom is created it is no more possible to generate a thumbnail, event if the checkbox to generate it is checked.
How would it be possible to generate the thumbnail after or during the migration ?
I think Rules would also be a solution, il a rule action to generate the thumbnail existed ...

Any hint ?

Thanks

Comments

web3h’s picture

If it can help:
I tried to generate Thumbnails with VBO after import by activating the "generate_thumbnail" function in the Scald Atoms operations view, but no thumbnail is generated.
If I manually modify and save the atom, the thumbnail is generated. But I have hundreds.
The VBO solution would be fine for me...

nagy.balint’s picture

hmm yes, thumbnail will only be generated on presave. But that also means that if during import, the option is set like $atom->data['scald_thumbnail_default'] is not empty, then at the save it should generate the thumbnail. So maybe you can set this data just before you save the entity in the migration script?

Which module implements the "generate_thumbnail" function? I cant seem to find it in scald or scald_file.

web3h’s picture

Sorry the exact name of the option is "scald_thumbnail_generation" in the scald_atoms_operations view.
In mass operations, it is not activated by default.

nagy.balint’s picture

I dont see such a string in scald either, maybe its provided by a 3rd party module, or its a generalization of something.

web3h’s picture

Found. The "scald_thumbnail_generation" is a Rules component someone else created, but it does nothing, just saving the atom and the thumbnail is not generated.
I am triying to set $atom->data['scald_thumbnail_default'] in the migration script, but without success.
How could I call the presave function in Views Bulk Operations ?

nagy.balint’s picture

Drupal should call that presave each time an atom is saved. So if you could the VBO to save the atoms with that setting, then it should work.

If such a thing is not possible, then I suppose that the provider could contain a VBO action that generates thumbnail for an atom, by setting this option and then saving the atom.

web3h’s picture

No. It doesn't work il I try to Use VBO to save the entity. But it works if I save it manually ...
If you could add a VBO thumbnail (re)generation function to the provider it would be great.

nagy.balint’s picture

Status: Active » Needs review
StatusFileSize
new968 bytes

So this is what I had in mind.

After applying this patch, clear Drupal cache and try the new action.

web3h’s picture

Perfect !
The patch is exactly what I needed.
Thank you very much. You saved my day this time again.

nagy.balint’s picture

Status: Needs review » Fixed

Thanks, Committed.

  • nagy.balint committed 3da3841 on 7.x-1.x
    Issue #2516836 by nagy.balint, web3h: Thumbnail generation with migrate
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.