Easy deployment of files (PNG, MP3)

I open a new dedicated thread for this subject (it was hard to find @guessed’s message).

[quote=“guessed, post:61, topic:173748”]Haven’t tried it from Lua, but the following captures the essence, and can likely be done from [tt]os.execute[/tt] directly (avoiding the Shell script decompress)

files=“Sonos.png Sonos_0.png Sonos_25.png Sonos_50.png Sonos_75.png Sonos_100.png”

for i in ${files}
if test -e ${i}.lzo;
echo “${i}.lzo exists, decompressing…”
if pluto-lzo d ${i}.lzo ${i};
echo “Removing ${i}.lzo”
mv ${i} ${target}
rm “${i}.lzo”
echo “Error decompressing ${i}.lzo”
echo “no ${i}.lzo exists”

But there’s a larger issue. I was running some tests and [tt]pluto-lzo[/tt], used in Vera’s file upload, is trashing the file. It does end up with a LZO suffix, but the file is only 16 bytes long.

I’ve always side-loaded these various files via scripts, so never noticed that before. If apps.mios.com is using the same technique, then we can’t have these marked as compressed.

As a result of this, I didn’t test the above any further. Of course, we can mod it to not apply compression (etc)[/quote]

Hi @guessed.

Is it your script that corruypted the file or is it the file upload from the dashboard UI ?

PS: I use the file upload of the dashboard intensively since months and never encountered such a problem.

It was utilising the upload from the dashboard UI and resulted in corruption affected of the icons and mp3.

Ok, it is what I understood when reading again the message today but not what I initially understood. (I thought it was the uncompress that failed).

Does someone else encounter the problem ?

What I could do is checking that the lzo file size is not less than feww bytes before uncompress it. If it is, the plugin could display a warning message to the user.

So, finally, that’s doable in my opinion.

You are correct, when they have been compressed it cannot be correct decompressed.
Example 1
Using trunk 116 Sonos_silence.mp3o 40kb
Upload through dashboard Sonos_silence.mp3.lzo now 12b
pluto-lzo d Sonos_silence.mp3.lzo Sonos_silence.mp3 now 4b

Example 2
Using trunk 116 Sonos_silence.mp3o 3kb
Upload through dashboard Sonos_100.png.lzo now 16b
pluto-lzo d Sonos_100.png.lzo Sonos_100.png now 8b

The compression is destructive as far I see and when decompressing it is failing… I haven’t look in the compressed file to see what reside after compression but not usable.
That about where we left off earlier this year and option… Packaging into tar.gz and deploying.

I will try it.
So the upload function from the dashboard would work with xml, json and lua files but not with png or mp3 files ?

[quote=“lolodomo, post:5, topic:175246”]I will try it.
So the upload function from the dashboard would work with xml, json and lua files but not with png or mp3 files ?[/quote]

Correct - digital destructive