Jump to content

JesseToxik

Members
  • Posts

    61
  • Joined

  • Last visited

About JesseToxik

  • Birthday 02/05/1991

Profile Information

  • Gender
    Male
  • Location
    Chattanooga, TN
  • Age
    22

JesseToxik's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello all, I am not sure if this is the right place to put this, but I am working on a template that uses png images for navigation icons. The backgrounds are set to transparent. All works fine in Chrome. When I view it in Internet Explorer my images look thicker/bolder and messy. How can this be fixed? Sorry I cannot link to a webpage as I am designing this on my localhost. *********************************************SOLVED********************************************* After looking around I found a solution. -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)"; /* IE8 */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF); /* IE6 & 7 */ I thought I would share it in case someone comes across my question and needs an answer.
  2. My page won't even load. All I get is Server errorThe website encountered an error while retrieving http://cronanpilotcar.byethost33.com/inc/scripts/ImageDelete.php. It may be down for maintenance or configured incorrectly. Here are some suggestions:Reload this webpage later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
  3. I am trying to write a script on a hidden page to delete images in my gallery(I am not using databases). I tried writing this code(to delete both the icon and large version of the image) but it failed. What did I do wrong? <?php if (array_key_exists('delete_file', $_POST)) { $filename = $_POST['delete_file']; if (file_exists($filename)) { unlink($filename); echo 'File '.$filename.' has been deleted'; } else { echo 'Could not delete '.$filename.', file does not exist'; } } $large = glob("/images/main/large/*"); $icons = glob("/images/main/icons/*"); foreach($large as $lrg && $icons as $icon) { echo "<div class='divimages'>"; echo '<img src="'.$lrg.'"/><br>'; echo '<img src="'.$icon.'"/>'; echo '<form method="post">'; echo '<input type="hidden" value="'.$lrg.'" name="delete_file" />'; echo '<input type="hidden" value="'.$icon.'" name="delete_file" />'; echo '<input type="submit" value="Delete image" />'; echo '</form>'; echo "</div>"; } ?>
  4. Its actually solved :/ I found a script that worked but I do not know how to delete this question since it was unneeded. Sorry
  5. I found a script that resizes all images in a given directory to a new size. I need some guidance to modify this script to my needs. The script resizes images to a specified image width and height. I would like to change that to make it scale the image to half the original size if it is above a certain size. I would also like for it to create a new image of a given size of 150px * 150px [icons]. How can I achieve this? <?php //Maximize script execution time ini_set('max_execution_time', 0); //Initial settings, Just specify Source and Destination Image folder. $ImagesDirectory = 'images/gallery/'; //Source Image Directory End with Slash $DestImagesDirectory = 'images/main/'; //Destination Image Directory End with Slash $NewImageWidth = 500; //New Width of Image $NewImageHeight = 500; // New Height of Image $Quality = 80; //Image Quality //Open Source Image directory, loop through each Image and resize it. if($dir = opendir($ImagesDirectory)){ while(($file = readdir($dir))!== false){ $imagePath = $ImagesDirectory.$file; $destPath = $DestImagesDirectory.$file; $checkValidImage = @getimagesize($imagePath); if(file_exists($imagePath) && $checkValidImage) //Continue only if 2 given parameters are true { //Image looks valid, resize. if(resizeImage($imagePath,$destPath,$NewImageWidth,$NewImageHeight,$Quality)) { echo $file.' resize Success!<br />'; /* Now Image is resized, may be save information in database? */ }else{ echo $file.' resize Failed!<br />'; } } } closedir($dir); } //Function that resizes image. function resizeImage($SrcImage,$DestImage, $MaxWidth,$MaxHeight,$Quality) { list($iWidth,$iHeight,$type) = getimagesize($SrcImage); $ImageScale = min($MaxWidth/$iWidth, $MaxHeight/$iHeight); $NewWidth = ceil($ImageScale*$iWidth); $NewHeight = ceil($ImageScale*$iHeight); $NewCanves = imagecreatetruecolor($NewWidth, $NewHeight); switch(strtolower(image_type_to_mime_type($type))) { case 'image/jpeg': case 'image/png': case 'image/gif': $NewImage = imagecreatefromjpeg($SrcImage); break; default: return false; } // Resize Image if(imagecopyresampled($NewCanves, $NewImage,0, 0, 0, 0, $NewWidth, $NewHeight, $iWidth, $iHeight)) { // copy file if(imagejpeg($NewCanves,$DestImage,$Quality)) { imagedestroy($NewCanves); return true; } } } ?>
  6. Works like a charm but made me realize something new. The desktop based images file size is too large for mobile. I need to develope a code that will take all the images in that directory and either make temporary smaller copies(best option for me) or make smaller copies for each new upload. Thanks for the help
  7. I have a new issue: I found a solution for the desktop version of my site but not the mobile site. <?php $files = glob('images/gallery/*.{jpg,png,gif}', GLOB_BRACE); // filesystem path with ../ foreach($files as $file) { echo ('<img src="/images/gallery/' . basename($file) . '" width="200px">'); // URL path with / } ?> The above works on dekstop but not on mobile and the below works on mobile but not on desktop. My mobile url is http://cronanpilotcar.byethost33.com/mobile <?php $files = glob('../images/gallery/*.{jpg,png,gif}', GLOB_BRACE); // filesystem path with ../ foreach($files as $file) { echo ('<img src="/images/gallery/' . basename($file) . '" width="200px">'); // URL path with / } ?>
  8. Ok so I wrote a new code that works except for one issue. It displays two broken images and the actual image in the folder. There is a single image in the directory so I do not understand why it is displaying the two broken images. <?php $files = scandir('images/gallery/'); // filesystem path with ../ foreach($files as $file) { echo ('<img src="/images/gallery/' . basename($file) . '">'); // URL path with / } ?>
  9. I tried that bit of code to no avail. I added a line to the code to see if it would echo the word test and it didnt work. <?php $files = glob('../images/gallery/*.{jpg,png,gif}', GLOB_BRACE); // filesystem path with ../ foreach($files as $file) { echo ('<img src="/images/gallery/' . basename($file) . '">'); // URL path with / echo('TEST'); } ?> I've used this code before on a locally hosted site but for some reason it wont work now.
  10. Hmm I went down the list. I didnt see any that offer monthly. All annual from what I saw.
  11. Was unaware of the dedicated thread. Thanks for the link.
  12. I am looking for a PHP web host that I can pay monthly. I am currently in the process of opening a business and would like to pay monthly for hosting and a domain and not have to worry about paying for a full year or two just to have the site functioning for a month or two. Any suggestions? Is it possible to keep my hosting on a free host and then use a custom domain to direct to it? Thanks.
  13. The page is http://cronanpilotcar.byethost33.com/page/photos and the image urls should appear as this one http://cronanpilotcar.byethost33.com/images/gallery/Mustang.jpg
  14. Well this is my code and it still isn't working :/ <?php $files = glob('/images/gallery/*.{jpg,png,gif}', GLOB_BRACE); foreach($files as $file) { echo ('<img src="/images/gallery/' . basename($file) . '">'); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.