I am uploading max 5 images and i want to create the thumbnails of those 5 images i am successful in uploading and saving image name in database but can't able to make thumbnails. //controller $files = $_FILES; $cpt = count($_FILES['uploadfile']['name']); for($i=0; $i<$cpt; $i++) { $_FILES['uploadfile']['name']= $files['uploadfile']['name'][$i]; $_FILES['uploadfile']['type']= $files['uploadfile']['type'][$i]; $_FILES['uploadfile']['tmp_name']= $files['uploadfile']['tmp_name'][$i]; $_FILES['uploadfile']['error']= $files['uploadfile']['error'][$i]; $_FILES['uploadfile']['size']= $files['uploadfile']['size'][$i]; $this->upload->initialize($this->set_upload_options()); $this->upload->do_upload('uploadfile'); $upload_data = $this->upload->data(); $name_array[] = $upload_data['file_name']; //success till here now inserting in database and creating thumbnails $fileName = $upload_data['file_name']; $images[] = $fileName; } $fileName = $images; var_dump($images); @$form['picture1']=$images[0]; @$form['picture2']=$images[1]; @$form['picture3']=$images[2]; @$form['picture4']=$images[3]; @$form['picture5']=$images[4]; // private function set_upload_options() { // upload an image options $config …

Member Avatar
Member Avatar
+0 forum 3

//index.php $img_dir ="C:/xampp/folders/img/*.jpg"; $thumb_width = 100; // Open a known directory, and proceed to read its contents $scan= glob($img_dir); foreach($scan as $image) { $im= imagecreatefromjpeg($image); $img_width = imagesx($im); $img_height=imagesy($im); $thumb_height= floor ($img_height *($thumb_width/$img_width)); $new_img=imagecreatetruecolor($thumb_width,$thumb_height); imagecopyresized($new_img, $im, 0,0, 0, 0, $thumb_width, $thumb_height, $img_width, $img_height); $thumb_path = "C:/xampp/folders/thumbs/"; imagejpeg($new_img,$thumb_path); } The error message `Warning: imagejpeg(C:\xampp\folders\thumbs): failed to open stream: Permission denied in C:\xampp\folders\index.php on line 32` he destination file has read and write permissions! Whats wrong with my code? ( I have used both / and \ slashes for file paths, and I still get the same error.)

Member Avatar
Member Avatar
+0 forum 1

As part of a project to manage my collection of photos, I wanted to add the capability of displaying a series of files as thumbnails. This posed me with three problems: 1. how to preserve the aspect ratio of the original images 1. how to generate the thumbnails without tying up the application 1. how to avoid running out of memory Because generating thumbnails of images is (I think) of reasonably wide interest I thought I'd write it up as a code snippet. To recreate the project, start with a blank form and add two buttons, btnDetails and btnThumbs. Add …

Member Avatar
Member Avatar
+3 forum 6

I've rewritten this question a half dozen times and each time it makes less sense. In a nutshell, I want to populate a listview with large icons representing image files but I can't get them to come out unstretched. They are always stretched along the x or y axis because the aspect ratios vary. Does anyone know how to create a thumbnail to go into an imageList so that the thumbnail is padded in either direction to prevent stretching?

Member Avatar
Member Avatar
+0 forum 10

So I have this code here: http://jsfiddle.net/4Cqkh/1/ What I'm trying to do is when I click on a thumbnail, the below larger image of it should display according to which thumbnail is clicked. I tried switching the larger image's src to that of the thumbnail src's value when clicked but it's not working correctly. (I had to exectuce the js's function by calling itself instead of using onclick since the onclick doesn't seem to work when I tried wrapping it into the img tag). Any help would be appreciated.

Member Avatar
Member Avatar
+0 forum 1

Hey guyz, I am here again with a PHP issue... I need to upload an image and create a thumbnail for the same. Yeah it's so simple. But the difficult part is that the user will create the thumbnail (not crop) by his own choice. Please help.

Member Avatar
Member Avatar
+0 forum 4

hi i need to show the last post thumbnail only i had the code but im now looking for code to get image i need to place the image on the top <ul> <?php $recent = new WP_Query("cat=1&showposts=10"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a></li> <?php endwhile; ?> <?php wp_reset_query(); ?> </ul>

Member Avatar
Member Avatar
+0 forum 2

Hi, it's me again. I got a little problem with displaying thumbnail images. I have a repeater which is containing thumbnail images. Each image will zoom-in to a defined bigger size if we click on the thumbnail. [CODE] <div class="thumb"> <a href="images/<%=request.querystring("div") %>/<%=request.querystring("veh") %>COST<%=reportdate.Value.ToString.Replace("/","")%><%# Eval("page") %><%# Eval("image_link") %>" onclick="return hs.htmlExpand(this, { objectType: 'iframe' } )"> <asp:Image ID="img_cost" runat="server" width="100" height="75" ImageUrl='images/<%=request.querystring("div") %>/<%=request.querystring("veh") %>COST<%=reportdate.Value.ToString.Replace("/","")%><%# Eval("page") %><%# Eval("image_link") %>' AlternateText="image COST" /></a> </div> [/CODE] The zooming-in works fine, but the thumbnails show no images, instead showing the AlternateText I already set. As you can see, I set the href and the ImageUrl …

Member Avatar
Member Avatar
+0 forum 1

Hi guys I need a little help in viewing all .txt files in a folder in a thumbnail view and allowing the user to open it in the default txt editor Any help would be appreciated Thank you

Member Avatar
Member Avatar
+0 forum 1

What this script does is take in an image and export a thumbnailed version. Function Arguments: $file : Desired image to create a thumbnail of $destination : End location for the thumbnail $zoom : Setting type, explained later (default: false) $t_width : Thumbnail width (default: 150) $t_height : Thumbnail height (default: 150) This script is capable of making 2 types of thumbnails: [LIST=1] [*]Cropped to fit (Small Preview) [*]Resized (Fit Width) [/LIST] A sample of this script is here: [URL="http://turt2live.com/PHP_Classes/thumbnails/"]http://turt2live.com/PHP_Classes/thumbnails/[/URL] If you would like the "Cropped to fit (Small Preview)" then set $zoom = true, otherwise, set it to false.

Member Avatar
Member Avatar
+0 forum 8

Hi, I want to capture snapshot of a URL. User enters URL, hits Capture button and sees the captured image of that website. I have done some google-ing but not real solution it. Does anyone know any example in PHP and only on Linux? Not interested 3rd party websites though. Thanks

Member Avatar
Member Avatar
+0 forum 7

Hi :) Is there any way, using PHP, to display a mini-version of an external website ? What I'm trying to achieve is when my users enter a link, then it should automatically try to display the link's contents - but within a given height / width. Appriciate any feedback :D

Member Avatar
Member Avatar
+0 forum 4

I need to be able to display a screenshot grab of specific websites in thumbnail size. Instead of going to the site and screenshotting it, I would like PHP to do the job for me. Is this possible?

Member Avatar
Member Avatar
+0 forum 13

This code is for a stand-alone file, named "thumbnail.php" or something similar. Once uploaded to your server, it can be called from inside an IMG tag. There are four options for this script without modifying anything. [LIST=1] [*]First, you can resize the image to a percentage of the original, as to maintain aspect ratio. [*]Second, you can set a maximum width for the thumbnails. [*]Third, you can set a maximum height for the thumbnails. [*]Lastly, if you do not specify a way to create the thumbnail, then the script defaults to creating a thumbnail 25% of the size of the …

Member Avatar
Member Avatar
+0 forum 5

I've looked at all of the lightboxes and I'm not sure if I'm not looking hard enough or if I'm looking in the wrong place. I'm looking for a plugin that I can use that will allow me to do the following. Have 1 row of images (about 5 images or so) that will auto scroll to the next image, moving the first image out of view to make room for the next image. It will do this for the whole album (more than 5 images total). I also want this gallery to allow me to load the picture that …

Member Avatar
Member Avatar
+0 forum 2

I have a C# website that includes AJAX. The site has a master page and sub pages. I am revamping the photo gallery sub page to include a jquery function that displays a larger version of a thumbnail image when hovered. The thumbnails are listed in a xaml file, at load the xaml file is read and formatted into a string that is then displayed a-portion-at-a-time. When the page initially loads everything is working fine. But, when I click the button to display another portion of the thumbnails (via AJAX) the jquery function stops working. Is this because jquery doesn't …

Member Avatar
Member Avatar
+0 forum 1

Hi everyone, I have been working on an image gallery to allow people to view/upload their photos. I have everything working pretty well except that I want to modify my upload script so that a thumbnail is generated of each picture that is uploaded and stored in a separate directory with the same name as the original picture. So there would be an "Uploads" directory where all full size images are stored, and then within that directory there would be a "Thumbs" directory where all the thumbnails will be stored (with the same name as the full size image). My …

Member Avatar
Member Avatar
+0 forum 3

The following script works GREAT. It uploads an image as well as adds info to mysql about the picture and its location. The problem is that the function "CreateThumbs" actually loops through the entire uploads directory and generates a thumbnail EVERY TIME you upload a picture. I am VERY new to php, and I was just wonder what I need to do to get it to ONLY generate a thumbnail for the picture that is being uploaded and NOT every picture within the uploads directory. - This means that if there are thousands of pictures in the uploads directory, every …

Member Avatar
Member Avatar
+0 forum 3

hi i am using windows application. in that form i place picturebox, openfiledialogue, loadimage, saveimage buttons. using loadimage button to load image into picture box. using saveimage button to save image into one folder(save image into harddisk) at the time of save image first we crop the image like height:100 and width:100 and next it saved to folder. how todo it. please give me a solution and please give a sample solution Thanks.

Member Avatar
Member Avatar
+0 forum 1

Hi all, How can we load contact thumbnail ?? I want to fetch it and preview it on canvas . thanks in advance.

Member Avatar
+0 forum 0

Which is the smarter way to do things.. Should I create a thumbnail script that resizes and crops the images so they are uniform when I create and upload a gallery? Or Should I run a script when the page loads that resizes and crops the images so they are uniform? What are the pros and cons of the two?

Member Avatar
Member Avatar
+0 forum 2

1. Imports System.IO 2. Create class "CreateThumbnails" or any class and place following function inside that class You need one function to response call back to main function Function ImageAbortDummyCallback() As Boolean Return False End Function

Member Avatar
+0 forum 0

Hi there. I am looking to create a script in php that will get an image from an upload form and upload it to a site using ftp. It needs to save the original image in the site images/full/ and also create a proportional image thumbnail (100x100) in images/thumb/ What is the simplest way to go about this? EDIT: Oh just to mention i need to create a script, not use a web app :)

Member Avatar
Member Avatar
+0 forum 1

hi all, i am trying to create a thubnail image and want to insert in a folder and path into database.. i uploaded image into folder but not able to create thumbnail from it [CODE]string s = @"~\uploads\" + FileUpload1.FileName; FileUpload1.PostedFile.SaveAs(Server.MapPath(s)); SqlConnection cn = new SqlConnection("Server=praveen;Integrated Security=True;User Id=sa;Password=sa;Initial Catalog=banking"); string sql = "insert into products values('" + ddlist.SelectedItem.Value + "','" + name.Text + "','" + s + "','" + code.Text + "')"; SqlCommand cmd = new SqlCommand(sql, cn); cn.Open(); SqlDataReader dtr; dtr = cmd.ExecuteReader();[/CODE] iam uploading into uploads folder and wanted to upload thumbnail into thumb folder which is in …

Member Avatar
Member Avatar
+0 forum 7

The End.