Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts

    Question PHP bitmap resize: which one is right?

    bitmap resize: which one is correct?
    PHP Code:
    switch ($oFile['type']){ 
     
    // which case below is correct?
     
    case 'image/bmp':
    case 
    'image/imagewbmp':
    case 
    'image/vnd.wap.wbmp':
     
    // which case above is correct? 
     
    $oldImage imagecreatefromwbmp($oFile['tmp_name']);
    imagecopyresampled($newImage$oldImage0000$newWidth$newHeight$oldWidth$oldHeight);
    imagewbmp($newImage$sFilePath); 
    break; 
    Last edited by student101; 03-13-2010 at 02:15 PM.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This one is: 'image/vnd.wap.wbmp'
    Best I know, wbmp is not related to bmp by way of file structure; the wbmp is for a wireless protocol, so I'd presume that its compressed in some fashion.
    Bitmap images themselves have an easy file structure. I don't believe that an imagecreatefromwbmp or imagecreatefromstring works on a bitmap image, but you can write you're own handling for it by following the bitmap file format on the wiki site.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • Users who have thanked Fou-Lu for this post:

    student101 (03-14-2010)

  • #3
    Regular Coder student101's Avatar
    Join Date
    Nov 2007
    Posts
    634
    Thanks
    80
    Thanked 15 Times in 15 Posts
    Yes that's what I came to understand,
    simpler just to deny that file type for uploads.
    Thanks for your support!
    Update MySQL with checkboxes | Tell A Friend | Delete MySQL with checkboxes

    Give thanks & resolve when done :thumbsup:


  •  

    Posting Permissions

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