Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 22:39

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: PNG Support
PostPosted: 12. Sep 2006, 19:44 
Offline

Joined: 12. Sep 2006, 19:40
Posts: 5
Hi,
I'm just wondering if there is PNG support in this gallery? I would use jpg but it's for a Pixel art forum, and jpg makes things go all artifacty, so we'd rather use PNG because of it's size and quality. BMP is too large. ;)

I'm quite sure there would be no licensing issues. If I'm right, PNG is open source or something like that.

Thanks for your time.
Matt


Top
 Profile  
 
 Post subject:
PostPosted: 12. Sep 2006, 22:42 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Right - actually not a problem - but I use png for all kind of images you can store in the folder like folder images, private images , watermarks ...

But actually it would be quite easy to use renamed png's. There has to be some changes in ~ 10 places to make this possible.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 12. Sep 2006, 23:01 
Offline

Joined: 12. Sep 2006, 19:40
Posts: 5
What changes would I have to make, and where? Is there a help on it?

Thanks for your time!

Matt


Top
 Profile  
 
 Post subject:
PostPosted: 12. Sep 2006, 23:19 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
it would be in the imagefunctions.inc.php

there you find something like
$src = imagecreatefromjpeg(

where the pictures are loaded.

before you find getimagesize in all of this functions.

this returns an array with the size [0] and [1].

[2] ist the filetype - You have to chechk this and then you can open the image with imagecreatefrompng

I think only 5 changes ...

but the output will still be a jpg.


at the end the file would be written - you have to change Imagejpeg to ImagePNG (depending on the input file).
but still with the jpg filename - the browser don't care - but not sure what putimage makes ...

lot's of small changes - you can try if you like ;).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Sep 2006, 00:02 
Offline

Joined: 12. Sep 2006, 19:40
Posts: 5
Sorry, but I'm not sure I understand what I need to do. :P
Could you be a bit more specific? I'm not a PHP coder.

Sorry for all this.
Thanks again,

Matt.


Top
 Profile  
 
 Post subject:
PostPosted: 13. Sep 2006, 00:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
then it's quite hard ;).

1. you have to use a png that has the extension jpg.
2. check which filetype is it really (getimagesize [2])
3. use the png function instead of the jpg function.
4. store the image as png and not as jpg (depending on the filetype).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Sep 2006, 00:32 
Offline

Joined: 12. Sep 2006, 19:40
Posts: 5
Aaah, do you think you could make an example, if you are not busy?

Once again, I'm very sorry to annoy you like this.

Thanks,
Matt.


Top
 Profile  
 
 Post subject:
PostPosted: 13. Sep 2006, 09:34 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
send me an email - i have made this change in the main resize function of twg. you would simply have to copy this to the other places where it is needed ;).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 13. Sep 2006, 16:37 
Offline

Joined: 12. Sep 2006, 19:40
Posts: 5
Thanks very much! I'll e-mail you now!

Thanks for all your help.
Matt.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: FAST WebCrawler [Crawler] and 84 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy