Log in

View Full Version : resolving thumbnail filenames


Simateoako
December 1st, 2009, 09:47 AM
this seems to be the best place to post this. I am creating a custom web interface for boxee to work with a touchscreen unit in my house. I am a php developer, so using my existing skillset seemed a better idea than attempting to learn ASP.

So far I have 90% of it working, but since the images in the sqlite tables are pointing to impawards (who doesn't allow hotlinking) I'm rather stuck on the thumbnails.

I see the thumbnail files (TBN) in their respective directories in boxee, but the file names appear to be an encrypted name that must somehow relate back to the original video.

how can I EASILY associate a video file with it's thumbnail?

DPK
December 1st, 2009, 10:07 AM
http://forum.boxee.tv/showpost.php?p=69250&postcount=4

Simateoako
December 1st, 2009, 11:21 AM
in case anyone else every encounters the same issue in the future, I found that someone converted the c# code posted on the XMBC site to php.

http://pastebin.com/f5d5a6ea9


<?php

function uint($i) {
if (0 > $i) {
$i += 0x100000000;
}

return (float)$i;
}

function crc32_ieee_802_3($string) {
$string = strtolower($string);

$crc = 0xffffffff;
$len = strlen($string);

for ($c = 0; $c < $len; $c++) {
$byte = ord($string[$c]);

$left24 = uint($byte << 24);
$crc ^= $left24;
$crc = uint($crc);

for ($i = 0; $i < 8; $i++) {
$left1 = uint($crc << 1);

if (uint($crc & 0x80000000) == 0x80000000) {
$crc = uint($left1 ^ 0x04C11DB7);
}
else {
$crc = $left1;
}
}
}

return str_pad(base_convert($crc, 10, 16), 8, '0', STR_PAD_LEFT);
}

echo crc32_ieee_802_3('123456789') . "\n";

?>