Chandan Pitta wrote:
> Hello,
>
> I was unable to attach files in the tracker so I am replying to this
> email with attachments. I made some changes to the webserver so that
> it can make use of child resources instead of creating several links
> in /var/cache/freevo. Not that I have anything against having all the
> links but it is easier making use of available features of twisted.
>
> In addition I added code to display .jpg file if a fxd file is missing
> and the .jpg file matches with the directory or file because that is
> how Freevo was doing it. I have some folders where I just have .jpg
> files with the name matching the movie file with no fxd and freevo
> displays the image but the webserver was not. With the modifications I
> made it is much closer to what Freevo does. You might want to add more
> formats (.png etc) if you like or I can add them if you tell me which
> formats to add.
>
> Finally I changed the way the fxd file is parsed to display
> "cover-img", since I am always getting index out of bounds exceptions
> for
>
> cover = str(b.attrs.values()[0])
>
> although I am using the fxd file as given in the examples. Freevo is
> able to display it fine on my TV. With the code changes I made, I am
> not getting any more exceptions.
>
> Please review the code and merge it if you like.
Great stuff Chandan, this fixes one of the main Freevo-1.7 bugs.
There is one new problem:
> + for (item, dir_str) in config.AUDIO_ITEMS:
> + root.putChild(dir_str.replace("/", "_"), static.File(dir_str))
causes a crash when the web radio has been activated, web radio is a
single fxd file and goes into AUDIO_ITEMS.
What is a bit of a problem is large image files, 7.2MegaPixel cameras
give an image typically 3072x2304 which is approximately 3MB, the
directory takes ages to display the images when there are more than a few.
What I have suggested to Wout is that we create a small image, and use
this as the img src.
The code to do this is (about line 510):
small_image_path = self.cache_dir + filepath.replace("/", "_")
if not os.path.exists(small_image_path):
size = (info['width'], info['height'])
new_size = self.resize_image(filepath, size)
image = imlib2.open(filepath)
new_image = image.scale(new_size)
new_image.save(small_image_path)
If you or Wout would like to do this it would be great.
I will need to do the same when "freevo cache" is run, but this needs to
be done first.
> However I could not solve one problem, I am unable to click on
> recorded TV programs from webpage. They are not active links. Is
> anyone facing the same problem?
These didn't work in the original patch either.
> Another question I always wanted to ask was, where do all the images
> for recorded TV go? There are no jpg files in my recording directory,
> but in Freevo I see the cover image. The .fxd files do not have
> cover-img tag. It would be nice to show them in the webserver.
The go into the overlay directory as raw files. From util/videothumb.py:
if image.mode == 'BGRA':
image.mode = 'RGBA'
if imagefile.endswith('.raw.tmp'):
f = vfs.open(imagefile[:-4], 'w')
data = (str(image.get_raw_data(format=image.mode)), \
image.size, image.mode)
f.write('FRI%s%s%5s' % (chr(image.width), \
chr(image.height), image.mode))
f.write(data[0])
f.close()
os.unlink(imagefile)
They get decode in util/fileops.py:
def read_thumbnail(filename):
"""
return image cached inside filename
"""
f = open(filename)
header = f.read(10)
if not header[:3] == 'FRI':
return read_pickle(filename)
data = f.read(), (ord(header[3]), ord(header[4])),\
header[5:].strip(' ')
f.close()
return data
image = pygame.image.fromstring(\
str(url.get_raw_data(format=url.mode)), url.size, url.mode)
Thanks again,
Duncan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel