On 1/1/07, Duncan Webb <[EMAIL PROTECTED]> wrote:
> Chandan Pitta wrote:
> > Hi Duncan,
> >
> > I could not apply your patch. I get the following error messages.
> >
> > patching file www/htdocs/library.rpy
> > Hunk #2 FAILED at 70.
> > Hunk #3 FAILED at 289.
> > Hunk #4 FAILED at 313.
> > Hunk #5 FAILED at 465.
> > Hunk #6 FAILED at 607.
> > 5 out of 7 hunks FAILED -- saving rejects to file www/htdocs/library.rpy.rej
> >
> > I am at r8883. Anyway seems like you code does almost the same things
> > as mine except that in your case if a cached image exists then it is
> > used without actually making sure if the size if what the user
> > requested. If we make WWW_IMAGE_THUMBNAIL_SIZE a config then it can
> > change any time and the code has to make sure it does what the user
> > want. In my code I make a check and rescale if necessary. Please see
> > if you can merge my code into you code changes or you can update the
> > svn with your patch and I will make the change or send me the correct
> > patch.
>
> Should have worked, oh well, have the same problem all the time.
>
> I'm wondering about this line, why is a + ".jpg" at the end of the line?
>
> scaled_image_path = self.cache_dir + filepath.replace("/",
> "_").replace(".", "_") + ".jpg"

For some reason imlib was having problems if the file name has a dot
anywhere else except than the extension. For example
my_trip1_10.10.2006.jpg is having problems. The only way I could avoid
it was to covert the dots to underscores but then imlib also wanted an
extension and would not write to my_trip1_10_10_2006_jpg, so I decided
to add ".jpg" at the end. I guess it could have been done more
elegantly by ripping out extension, converting to underscore and then
re-attaching the extension, but did not bother.

>
> It was you patch with, but using:
> new_image = image.scale_preserve_aspect(config.WWW_IMAGE_THUMBNAIL_SIZE)
> Which means that resize_image_to_square could go, but I see we need this.
>
> This means that I can now change freevo cache to create these images.
> And this means that the library.rpy need to read the cached image size.
> I'll let you know when this is done.

Excellent!

>
> kaa.imlib2 uses tuples for sizes, so we should stick to tuples for the
> sizes too. I haven't done these changes.

Yes using tuples makes sense, but how many files are affected? I think
I can take a look at library.rpy but I guess there may be several
places where code needs to be changed.

>
> The other stuff was just a few extra prints, which are not needed.
>
> >
> > Coming to the issue with your images from cache not showing up, did
> > you patch the webserver.py with the patch I sent? Basically it this
> > line available in src/helpers/webserver.py?
> >
> >     root.putChild(config.FREEVO_CACHEDIR.replace("/", "_"),
> > static.File(config.FREEVO_CACHEDIR))
>
> I missed this, as I had already done the changes, almost exactly the
> same as you, so the patch was rejected. :(

Interesting. I am using the latest svn and everything is working fine.
I even changed WEBSERVER_CACHEDIR to a different location and tested
and it seems to be working fine. Can you do a quick test to see if
twisted recognized the child resource by trying something like
http://localhost:<your_port>/_home_chandanp_temp/ in your browser.
Replace _home_chandanp_temp with what ever your WEBSERVER_CACHEDIR is
pointing to (do a print in __init__ of library.rpy or somewhere just
to be sure) with all "/" replaced with "_". You should be able to see
the folder listing (if twisted has permission to that folder). If you
see "404 - No Such Resource", then it is a problem with twisted.

A very happy and prosperous new year to you and all. Hope Freevo will
see a new level of sophistication.

Best Wishes,
Chandan


>
> The last revision is now 8889.
>
> Happy new year
> 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
>

-------------------------------------------------------------------------
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

Reply via email to