SitePoint Sponsor

User Tag List

Page 4 of 31 FirstFirst 1234567814 ... LastLast
Results 76 to 100 of 767
  1. #76
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for making gif thumbnails you need to have gd version which supports gif ... as the code will try to call functions specific to gif ... check your phpinfo() [under gd specifications] it will show you the list of mime types supported by GD installed with your php ...

    for this array:

    PHP Code:
    $photo_types = array( 
    'image/pjpeg' => 'jpg'
    'image/jpeg' => 'jpg'
    'image/gif' => 'gif'
    'image/bmp' => 'bmp'
    'image/x-png' => 'png' 
    ); 
    you can simply remove the gif listing to disallow any gif uploads ...

    PHP Code:
    $photo_types = array( 
    'image/pjpeg' => 'jpg'
    'image/jpeg' => 'jpg'
    'image/bmp' => 'bmp'
    'image/x-png' => 'png' 
    ); 
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  2. #77
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldnt this be easier putting the images into the db itself also not just a referance and how would I go about doing this the best way because doing it this way into the file atm is starting to give me the ****s with a coupla updating and syncro issues between different servers that i'm thinking this would be much better of putting the images themselves into the database..

    Thoughts on this please....

  3. #78
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well ofcourse you can do that but i would not advise it ... as mysql space is limited on servers ... so if you are planing to store 100 mb of images in the db, then i am not sure you will find many hosts offering that ...
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  4. #79
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is their a better way to name the files then? and on the new server the thumbnail images come up funny colours but the fullsized image is comming up as surposed to any ideas on what is causing this?

  5. #80
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well the funny colors might be due to GD 1.6.x or lower version which supports only 256 colors ... so when you upload a image it will resize them to a thumbnail using only 256 colors (dithering to the nearest color).
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  6. #81
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will have to check that out but yeah maybe

  7. #82
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mayank
    well the funny colors might be due to GD 1.6.x or lower version which supports only 256 colors ... so when you upload a image it will resize them to a thumbnail using only 256 colors (dithering to the nearest color).
    That happened to me when I first fired up the sample code. I had to mod the code to not do the 1.6 ver. resize but do the 2.0 instead.

    Man this is nice... surfing from my laptop looking out at the ocean. I am on VACATION!!!!!!

  8. #83
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man this is nice... surfing from my laptop looking out at the ocean. I am on VACATION!!!!!!
    how do you mod the code mate to do that?

  9. #84
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my php setting on the server that the site runs on

    gd

    GD Support enabled GD Version bundled (2.0 compatible) FreeType Support enabled FreeType Linkage with freetype GIF Read Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled

    and this is the link to the thumbnails that are comming up strang colors

    http://www.radiorally.org.au/pic/index.php

    take a look and give me a guess what it might be caused by

  10. #85
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    which code fragment are you using ... GD 2 or GD 1.x.x ?
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  11. #86
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Morristown, TN
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by noddy
    take a look and give me a guess what it might be caused by
    But is your code setup to use gd 2.0?

    PHP Code:
    // Build Thumbnail with GD 2.0

    $function_suffix $gd_function_suffix[$filetype]; 
    $function_to_read 'ImageCreateFrom' $function_suffix
    $function_to_write 'Image' $function_suffix

    // Read the source file 
    $source_handle $function_to_read($images_dir '/' $filename); 
            
    if (
    $source_handle) { 
    // Let's create a blank image for the thumbnail 

    $destination_handle ImageCreateTrueColor ($thumbnail_width$thumbnail_height);

    // Now we resize it 
    ImageCopyResampled($destination_handle$source_handle0000$thumbnail_width$thumbnail_height$size[0], $size[1]); 
    }     

    // Let's save the thumbnail 
    $function_to_write($destination_handle$images_dir '/tb_' $filename); 

  12. #87
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.radiorally.org.au/info.php

    its got gd on the server

  13. #88
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi all,

    i've just started this article, and am a bit confused with the code within perupload.php.

    PHP Code:
    Select Category 
         
    <select name="category"
         
    $photo_category_list 
         
    </select
       </
    td></tr
       <!
    —Insert the image fields here --> 
       
    $photo_upload_fields 
       
    <tr><td
    Why have U used PHP code within HTML without braking out of the PHP tags. Wont this cause errors??

    Tryts

  14. #89
    Fully Sweet Car noddy's Avatar
    Join Date
    Aug 2002
    Location
    Perth, Western Australia
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that code should have echo <<<__HTML_END
    <select name="category">
    $photo_category_list
    </select
    >
    </
    td></tr
    >
    <!
    —Insert the image fields here
    -->
    $photo_upload_fields
    <tr><td>

    __HTML_END;

    around it

  15. #90
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Nope GD could legally support GIF at the moment as the patent has expired although as stated on the GD website earlier this year there is to be no GIF support until early 2004 for some reason or other that I cannot remember...

    Though I think they're waiting on something or other before they release the GIF support in the current GD releases... ?
    Its because thats when the patent expires in the EU, if I remember correctly.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  16. #91
    SitePoint Enthusiast
    Join Date
    Sep 2003
    Location
    New York
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You guys have some knowledge abaut this stuff, I am almost ashamed to ask some early beginner questions.
    please take a look at this Screenshot and tell me if this is correct so far.

    http://www.quickflicks.0catch.com/Fi...togallery.html

    Not able to follow the tutorial.

    Before we can upload the images, we require a directory in which to store them. Therefore, let’s make a new directory, and name it “photos” (for *nix servers, set write permissions for this directory using chmod, e.g. 777
    How do I build a directory in which to store them? Totally lost.
    Last edited by Norbert Bissinge; Sep 27, 2003 at 22:05.

  17. #92
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you can do that via your FTP program itself ...
    else windows server you can make a new directory by executing the following command:

    PHP Code:
        md photos 

    for *nix servers,

    PHP Code:
        mkdir photos 
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  18. #93
    SitePoint Member
    Join Date
    Jun 2003
    Location
    Olathe
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mayank
    for making gif thumbnails you need to have gd version which supports gif ... as the code will try to call functions specific to gif ... check your phpinfo() [under gd specifications] it will show you the list of mime types supported by GD installed with your php ...

    for this array:

    PHP Code:
    $photo_types = array( 
    'image/pjpeg' => 'jpg'
    'image/jpeg' => 'jpg'
    'image/gif' => 'gif'
    'image/bmp' => 'bmp'
    'image/x-png' => 'png' 
    ); 
    you can simply remove the gif listing to disallow any gif uploads ...

    PHP Code:
    $photo_types = array( 
    'image/pjpeg' => 'jpg'
    'image/jpeg' => 'jpg'
    'image/bmp' => 'bmp'
    'image/x-png' => 'png' 
    ); 
    Silly question - but I haven't had time to test this out yet. Assuming that I have GIF (read only) support in my GD library. Shouldn't it be possible for me to create a thumbnail from a gif upload in PNG or JPG format. Or even convert both the full size image and the thumbnail to a supported write format?

    And is there going to be a difference with using BMP in the code above, if my GD library lists WBMP Support and nothing that looks like plain vanilla BMP?

    thanks

    El
    Last edited by Ealameda; Sep 29, 2003 at 09:18.

  19. #94
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well as you just have read-only access ... the only thing you can do is convert it online to a known format as you suggested ...
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  20. #95
    Anonymous
    SitePoint Community Guest
    i have the code working on my home pc. i have uploaded to my webspace and am getting an error message:

    Warning: open_basedir restriction in effect.

    is this something to do with the code, or is it my hosting company?

  21. #96
    SitePoint Member
    Join Date
    Sep 2003
    Location
    germany
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    setting upload_max_filesize do not work

    Quote Originally Posted by mayank
    the total size of files you can upload at one go is limited to the value set in your php.ini for, upload_max_filesize

    By default it is set to 2M (= 2 MB)




    at which line no. do you get the error?
    i used your code as it and it works well. BUT only 6 from 9 files i tried to upload has been uploaded an resized. The rest is somewhere in nirvana...

    9 files together there is only 900KB...

    and here is the setting of the php.ini file:

    post_max_size = 8M
    upload_max_filesize = 8M


    timeout was set in php code to: set_time_limit(0)

    any idea ???
    minskat

  22. #97
    Anonymous
    SitePoint Community Guest
    On the last page of this, you seem o have two functions for deleting photos - both very similar. Which one works? One is mis-labeled 'edit category details'.

  23. #98
    SitePoint Enthusiast mayank's Avatar
    Join Date
    Jul 2003
    Location
    India
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks like this code has been added by mistake ... it wasn't in the original draft ... maybe a typo error ...

    PHP Code:
    Editing Category Details

    function delete_photo$photo_id 

     global 
    $images_dir
     
    $result mysql_query"SELECT photo_filename FROM gallery_photo WHERE photo_id='".addslashes$photo_id )."'" );   
     list(
    $filename) = mysql_fetch_array$result ); 
     
    mysql_free_result$result ); 

     
    unlink($images_dir."/".$filename); 
     
    mysql_query"DELETE FROM gallery_photo WHERE photo_id='".addslashes$photo_id )."'" ); 
    }/ 

    don't use this one ... use the other one ...
    its possible ...

    < S-Point Articles :: Albinator :: mgZhome :: Beyond illusions />

  24. #99
    Lost
    Join Date
    Dec 2002
    Location
    Norway
    Posts
    225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is just what've been looking for, or.. at least parts of it

    Thing is, i'm trying to get this to work pr. user, more or less like this:
    http://www.selectdevelopment.com/aut...at.php?v_cat=6

    What I mean is that when the user log in, he will be able to create an ad, and uploading 5 pictures trough this gallery.

    Anyone have any ideas?

  25. #100
    Anonymous
    SitePoint Community Guest
    I want to put a next and back button on the viewgallery.php Full Size
    View page. Anyone know how to do that?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •