Author Topic: thumbnails generation  (Read 8709 times)

altert

  • Newbie
  • *
  • Posts: 5
    • View Profile
thumbnails generation
« on: January 05, 2011, 11:59:55 am »
Hello

Some of the documents I'm trying to work with in fengoffice are quite large images. As far as I understood there is no thumbnail generated for uploaded images. I've managed to add image preview for documents list, but as it is based on full file ('download file') - it's not suitable for large images. Is there some support for thumbnails of uploaded images, or could someone point me to uploaded file processing scripts, so I could add one?

franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: thumbnails generation
« Reply #1 on: January 05, 2011, 12:03:08 pm »
Hello, welcome to Feng Office Forums.
There is a thread, in this section if I remember correctly, which is about having pictures thumbnails. I am sure you will be able to find it if you look for it with the Search engine.

Best regards,
Francisco
Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

altert

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: thumbnails generation
« Reply #2 on: January 05, 2011, 12:09:33 pm »
thanks

Yes, I've checked that topic (I assume it's this one - http://forums.fengoffice.com/index.php?topic=2208.0 )

But this mod uses full url to download file to show it in widget and it won't help with large images (I'm talking about 10-100Mb), what I'm interested in is thumbnail file generated on file upload, so I can use these thumbnails in a way this mod suggested or in documents file list.


franponce87

  • Administrator
  • Hero Member
  • *****
  • Posts: 1819
    • View Profile
    • Email
Re: thumbnails generation
« Reply #3 on: January 07, 2011, 11:15:30 am »
Yes, my bad. I understood your problem now.
You may make thumbnails and store them in a new folder (or wherever you please to store them) and then just show the thumbnails in case the picture is bigger than 'value'.
May be this function helps?
http://php.net/manual/en/function.pdf-add-thumbnail.php

Otherwise, if you google 'create thumbnails+php' I am sure you will get tons of results as I have already done it before in a different project and it was quite easy, but it might take you some time depending on your skills of course.

If you happen to develop this feature, it would be great if you could post it later in here, so other people may have access to it as  well.

Best regards and thanks in advance if you decide to contribute with the Community,
Francisco

Would you like to install Feng Office Professional or Enterprise Edition in your servers? No problem! Read this article!

altert

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: thumbnails generation
« Reply #4 on: April 29, 2011, 05:29:30 pm »
I've implemented that feature, but my solution is very much a hack. I've modified FileRepository Filesystem class to create thumbnails for images and store them along with the main files. Then I've added controller functions in files.php and finally modified filemanager.js to introduce new column with previews for images.
I can share the code if someone is interested, but it's of dubious quality.

tez

  • Freshman
  • *
  • Posts: 15
    • View Profile
Re: thumbnails generation
« Reply #5 on: January 31, 2013, 09:35:35 pm »
I need this too. I have my Email and Documents in Feng Office online webserver.

My clients send me photos to put on their website, but their photos are huge. These files load fully every time I want to see what the file is or if I want to edit description, relation, comments etc - it loads the whole photo.

I've done lots of projects where I had to add thumbnail generation, I'm thinking that you might be able to use just one new function -
"DisplayThumb(id,width,height)"
inside that function you check for existing thumb

if file is NOT jpg,png,gif etc do usual thing or do nothing. return;

if thumb filedate is older than original ID filedate then generate new thumb and save as /cache/thumbs/id_XXX_YYY.png (?) thumb generation does get complex when it comes to alpha channels.

show thumb at requested size

---
Then you'd have to put that function into the columns, but I have no idea about that.