PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   "How Do I..." Questions (http://www.photoplog.com/forum/forumdisplay.php?f=7)
-   -   extensions (http://www.photoplog.com/forum/showthread.php?t=74)

saint@t-og.net 02-14-2006 12:11 PM

extensions
 
hi, currently you can't upload .bmp files to photoplog, does anyone know how I can make my gallery capable of doing this?

Please help :)

Nitro 02-14-2006 01:14 PM

I am guessing you would need to make changes in upload.php edit.php and to the thumb creating function in functions.php.

As to exactly what code you would need to add I dont know, I would guess the thumb code would be the hardest element tho. ;)

saint@t-og.net 02-14-2006 03:32 PM

yea, i think im guna have to look at it myself because noone else seems to know :S ty anyway

Morgan 02-14-2006 04:02 PM

PhotoPlog Lite uses the GD library for image processing, but it is currently not possible to process BMP files using the GD library. Not sure why, but perhaps it is because BMP files tend to be rather large and might lend more to size and timeout issues. That said, you could edit files like Nitro suggests, using this:
Code:

!in_array($photoplog_file_type, array('image/bmp','image/gif','image/jpeg','image/pjpeg','image/png'))
Instead of this:
Code:

!in_array($photoplog_file_type, array('image/gif','image/jpeg','image/pjpeg','image/png'))
And using this:
Code:

!in_array($photoplog_file_check[2],array(1,2,3,6))
Instead of this:
Code:

!in_array($photoplog_file_check[2],array(1,2,3))
Though there is still the thumbs issue, where you could use width / height attributes to resize, but basically there would need to be some rewrite of the code, whether through the use of the ImageMagick program or custom BMP functions, to account for the lack of BMP support in the GD library.

saint@t-og.net 02-15-2006 11:16 AM

i have already been through and changed

Code:

array(1,2,3))
to
Code:

array(1,2,3,4))
was there any reason it should be 6?

Also I changed
Code:

'image/gif','image/jpeg','image
To
Code:

'image/gif','image/bmp','image/jpeg','image
I was wondering, with bmp the file types are infact bitmap imamges where as jpg ones are jpeg and in the coding jpeg is used do you think that I need to put in

Code:

'image/bitmap','image/gif','image/jpeg','image
At the moment with the edits I have made uploading 'bmp' doesnt work. (Says sorry: user bad file)

Cheers

Morgan 02-15-2006 01:43 PM

Number 4 is for SWF files, number 6 is for BMP files. The bitmap MIME Type is image/bmp though there might be others:
Code:

image/bmp
image/x-bmp
image/x-ms-bmp
image/x-mspaint
image/x-win-bmp
image/x-windows-bmp

These changes alone won't get around the bigger issue: PhotoPlog Lite uses the GD library for image processing, but it is currently not possible to process BMP files using the GD library, so there would need to be some rewrite of the code, whether through the use of the ImageMagick program or custom BMP functions, to account for the lack of BMP support in the GD library.

ImageMagick binaries can be run via hell through the use of the exec function. Custom BMP functions are functions that would need to be created to handle BMP files. ImageMagick is probably preferable, but not every hosting account has ImageMagick or allows the exec function. For larger than large BMP files, custom BMP functions might be too slow to be of any real use.

Either way though, it is possible to upload BMP files but not with a quick edit here or there.

saint@t-og.net 02-15-2006 02:00 PM

ok i have changed the 4 to 6 from my previous edits, ow instead of saying "bad file" it says "bad save"

Morgan 02-15-2006 02:10 PM

That's because PhotoPlog Lite cannot make thumbs from BMP files, because PhotoPlog Lite uses the GD library for image processing, but it is currently not possible to process BMP files using the GD library, so there would need to be... ;)

saint@t-og.net 02-15-2006 02:15 PM

ok, not to worry, im guna have to live with JPG's, its going to be hard trying to teach the gamers! they aren't too good with designs/ images. In your postbit you have a link to your gallery... Is this a released mod? If so where can i find this :) cheers. ty for the help

Morgan 02-15-2006 02:31 PM

Think of the bandwidth you'll save using JPGs instead of BMPs. ;)

The gallery link (with count) in postbit is part of the pro version.

You can add a general link by using the following in postbit:
Code:

<a href="http://www.YOUR-DOMAIN.com/photoplog/index.php?$session[sessionurl]u=$post[userid]">Gallery</a>


All times are GMT. The time now is 09:52 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.