Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Uploading to site without users logging in
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=2770
Page 1 of 1

Author:  noetus [ 29. Oct 2010, 21:37 ]
Post subject:  Uploading to site without users logging in

Here's what I want. (Great application btw!) The site itself will be password protected as this is a private site. In other words there is no username for the site, just a password question like 'What is my birthday?" and only people who know me will be able to access the site.

Once people get past the initial password, they can view everything and upload only to a specific folder created for uploading. (I sort through the pictures people upload there later.)

I thought perhaps of creating a user with upload privileges and linking that user to the folder for uploading, and then have that user be automatically logged in when the folder is selected. (I don't want people to have to enter another password to upload or enter any username/password combo at any time.)

But I don't know how to have a user automatically logged in like that. Is it possible? Or is there another way of doing what I want?

Author:  TinyWebGallery [ 30. Oct 2010, 01:56 ]
Post subject:  Re: Uploading to site without users logging in

I have implemented something like that in combination with JFU.

check
http://www.tinywebgallery.com/en/faq.php#h52 - New 1.8 - I have not tested this without the multi root. But you can ;).

- Michael

Author:  noetus [ 30. Oct 2010, 10:20 ]
Post subject:  Re: Uploading to site without users logging in

Great - I used a standalone install of JFU and linked to an 'upload.html' file containing the javascript in the JFU folder from the folder.txt file where I want to give people the link to upload. This bypasses the backed/frontend uploader in TWG altogether, and seems to work well. It's great I can put all kinds of html in folder.txt, including javascript!

However, I have another problem. I want photos to be upsized as well as downsized to a specific size. So I have selected 1280 say as the only resize option on the flash uploader. That's fine for files larger than 1280, they get downsized. But files smaller - they aren't changed in size. The reason I want to do this on upload is that I find the resizer in TWG that resizes on the fly in Galleries to be not very good quality, it doesn't seem to use a bicubic algorithm for example. So I'd prefer to have all my images upsized as well. I could do this manually before uploading but that's a pain, and my users might not do it.

There must be a way of implementing this?

Author:  TinyWebGallery [ 30. Oct 2010, 11:10 ]
Post subject:  Re: Uploading to site without users logging in

JFU uses the same function for resize as TWG. If you like better quality than gdlib you can switch to image magick which is supported by TWG and JFU.

you can also increase the quality by setting the compression factor (only in TWG - in JFU is is set to 80 currently - I have added a variable for this in my local build already)

Best,
Michael

Author:  noetus [ 30. Oct 2010, 12:16 ]
Post subject:  Re: Uploading to site without users logging in

I am already using Image Magick.

The issue is not the compression ratio (which I had already increased slightly), it's the lack of bicubic etc resizing. When smaller images are made larger you can see the jaggies.

Author:  TinyWebGallery [ 30. Oct 2010, 13:31 ]
Post subject:  Re: Uploading to site without users logging in

check the options of image magick:

http://www.imagemagick.org/script/comma ... nterpolate

Is this what you are looking for?

Look for "-quality" in my code. There you can add the option. If you have a much better result please let me know. I then add this to my code as well.

- Michael

Author:  noetus [ 30. Oct 2010, 17:58 ]
Post subject:  Re: Uploading to site without users logging in

I found "-quality" in the following files:

info.php (twice)
tfu_helper.php (twice, the second time because I have TFU as a separate install)
imagefunctions.inc.php

I added "-interpolate bicubic" to tfu_helper.php and noticed a slightly increased uploading time (more processing to do).

I added "-interpolate bicubic" to imagefunctions.inc.php but didn't notice any difference in the quality of images that are increased in size. You can see what I mean form the screenshot I took <a href="http://www.raasay.org/imagemagick.jpg">here</a> - look at the bald guy's head. You can see that no interpolation was performed when the image size was increased. It definitely should have improved.

Is there a way I can check for sure that image magick is being used for the resize? It is set in the options but it seems worthwhile checking.

Author:  noetus [ 30. Oct 2010, 18:17 ]
Post subject:  Re: Uploading to site without users logging in

OK, so I discovered image magick was NOT set in my config.php - I forgot I had since reset a lot of settings. I set it, and that fixed things. For purposes of comparisons, here are three comparisons:

Image Magick switched OFF (GD I guess doing the resize):
#removed_broken_link

Image Magick switched ON WITH -interpolate bicubic:
#removed_broken_link

Image Magick switched ON using default settings (no -interpolate):
#removed_broken_link

As you can see, Image Magick is a HUGE improvement, not just in the jaggedyness but in the colours as well. It's debateable though whether adding -interpolate really adds any quality. It might be nice though to have more of image magick's command line options available in config.php. And definitely I would tell your users to install Image Magick for overall quality if they can!

Author:  TinyWebGallery [ 31. Oct 2010, 19:16 ]
Post subject:  Re: Uploading to site without users logging in

and it's faster as well ;).

- Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/