I am exploring custom thumbnails for files such as ai and obj. I have downloaded and tried p4thumb, but the supported filetypes are not enough for me, so I am searching for alternatives.
The documentation is a bit sparse, so I hope that some of you have more information.
p4thumb tells me the following: "P4Thumb converts Qt-supported image formats to a small PNG image." - so the format it produces seems to be a png - what might "small" mean in terms of resolution?
Further it states it "Sets thumbnail image attribute on compatible image files." What image files are compatible?
So far so good - I have read that I can use
p4 fstat -Oae -A thumb //depot/imageFile#revto see the thumbnail custom data.
If I run this on a png file, it indeed lists attr-thumb and a value that looks like a hex dump of what might be a thumbnail. So maybe I can use custom tooling to write this data to another file, for example an adobe illustrator file?
According to the manual, p4 attribute reads data from stdin, so I saved the thumb attribute from a png to a text file and piped that to p4 attribute as follows:
cat out.txt | p4 attribute -e -n thumb -i test.ai(-e is for hex data, -i is to read from stdin)
After submitting that file, test.ai now has an attr-thumb attribute that is identical to the png I copied it from. I would now assume p4v picks up that attribute and displays it in the preview tab - instead "No preview available for this item" is displayed.
Should this method work at all? Do I have to "tell" perforce somehow that it should use "attr-thumb" data for certain files? In the end, I would love if I could write a small application that could produce my own thumbnails and set them on a file. Does anyone have experience with this?