Search Results

Search found 1071 results on 43 pages for 'jpeg'.

Page 12/43 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Problems with Snow Leopard, Django & PIL

    - by Cato Johnston
    Hi I am having some trouble getting Django & PIL work properly since upgrading to Snow Leopard. I have installed freetype, libjpeg and then PIL, which tells me: --- TKINTER support ok --- JPEG support ok --- ZLIB (PNG/ZIP) support ok --- FREETYPE2 support ok but when I try to upload a jpeg through the django admin interface I get: Upload a valid image. The file you uploaded was either not an image or a corrupted image. It works fine with PNG files. Any Ideas?

    Read the article

  • Skia Decoder fails to decode remote Stream

    - by Samuh
    I am trying to open a remote Stream of a JPEG image and convert it into a Bitmap object: BitmapFactory.decodeStream( new URL("http://some.url.to/source/image.jpg") .openStream()); The decoder returns null and in the logs I get the following message: DEBUG/skia(xxxx): --- decoder->decode returned false Note: 1. the content length is non-zero and content type is image/jpeg 2. When I open the URL in browser I can see the image. What is that I am missing here? Please help. Thanks.

    Read the article

  • jQuery and Canvas.toDataURL

    - by Jeff
    I'm working on a script, and a small part of that involves taking a canvas and converting it to a downloadable image. To do this, I do: var thumb_jpeg = thumbnail.toDataURL("image/jpeg"); $("#" + options.dest).attr('src',thumb_jpeg); ...where thumbnail is a canvas tag and options.dest is the name of an img id. This code works perfectly in Chrome, but when I try it in Firefox, Firebug throws up this error: Security error" code: "1000 var thumb_jpeg = thumbnail.toDataURL("image/jpeg"); I would link to the whole script, but everything is hosted on my computer. Does anyone have any idea what this might mean? Thanks! Jeff

    Read the article

  • Opencv python and webcam

    - by Neil Benn
    Hello, I'm working with OpenCV on a beagleboard with ubuntu and OpenCV 1.1 interfaced via Python. I'm trying to set something up to capture a feed from a UVC compatible webcam (logitech C250). I have tested the webcam with luvcview and it works but only if I set the input format to YUV. If I run it in 'normal' mode I am getting back jpeg frames and something - somewhere is not happy! I'm trying to connect with the webcam in OpenCV as I want to get the image back from the webcam and run some analysis on it. As I have a limited device this seems to be the most efficient way of doing it - however I need to instruct the capturing system to capture in YUV and not jpeg. Is there a way of doing this (for example luvcview allow me to enter luvcview -f YUVY)? Cheers, Neil

    Read the article

  • How to change image through click - javascript

    - by Elmir Kouliev
    I have a toolbar that has 5 table cells. The first cell looks clear, and the other 4 have a shade over them. I want to make it so that clicking on the table cell will also change the image so that the shade will also change in respect to the current table cell that is selected. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <title>X?B?RL?R V? HADIS?L?R</title> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="N&SAz.css" /> <link rel="shortcut icon" href="../../Images/favicon.ico" /> <script type="text/javascript"> var switchTo5x = true; </script> <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script> <script type="text/javascript"> stLight.options({ publisher: "581d0c30-ee9d-4c94-9b6f-a55e8ae3f4ae" }); </script> <script src="../../jquery-1.7.2.min.js" type="text/javascript"> </script> <script type="text/javascript"> $(document).ready(function () { $(".fade").css("display", "none"); $(".fade").fadeIn(20); $("a.transition").click(function (event) { event.preventDefault(); linkLocation = this.href; $("body").fadeOut(500, redirectPage); }); function redirectPage() { window.location = linkLocation; } }); $(document).ready(function () { $('.preview').hide(); $('#link_1').click(function () { $('#latest_story_preview1').hide(); $('#latest_story_preview2').hide(); $('#latest_story_preview3').hide(); $('#latest_story_preview4').hide(); $('#latest_story_main').fadeIn(800); }); $('#link_2').click(function () { $('#latest_story_main').hide(); $('#latest_story_preview2').hide(); $('#latest_story_preview3').hide(); $('#latest_story_preview4').hide(); $('#latest_story_preview1').fadeIn(800); }); $('#link_3').click(function () { $('#latest_story_main').hide(); $('#latest_story_preview1').hide(); $('#latest_story_preview3').hide(); $('#latest_story_preview4').hide(); $('#latest_story_preview2').fadeIn(800); }); $('#link_4').click(function () { $('#latest_story_main').hide(); $('#latest_story_preview1').hide(); $('#latest_story_preview2').hide(); $('#latest_story_preview4').hide(); $('#latest_story_preview3').fadeIn(800); }); $('#link_5').click(function () { $('#latest_story_main').hide(); $('#latest_story_preview1').hide(); $('#latest_story_preview2').hide(); $('#latest_story_preview3').hide(); $('#latest_story_preview4').fadeIn(800); }); $(".fade").css("display", "none"); $(".fade").fadeIn(1200); $("a.transition").click(function (event) { event.preventDefault(); linkLocation = this.href; $("body").fadeOut(500, redirectPage); }); }); </script> </head> <body id="body" style="background-color:#FFF;" onload="document"> <div style="margin:0px auto;width:1000px;" id="all_content"> <div id="top_content" style="background-color:transparent;"> <ul id="translation_list"> <li> <a href=""> AZ </a> </li> <li> <a href="#"> RUS </a> </li> <li> <a href="#"> ENG </a> </li> </ul> <div id="share_buttons"> <span class='st_facebook' displayText='' title="Facebook"></span> <span class='st_twitter' displayText='' title="Twitter"></span> <span class='st_linkedin' displayText='' title="Linkedin"></span> <span class='st_googleplus' displayText='' title="Google +"></span> <span class='st_email' displayText='' title="Email"></span> </div> <img src="../../Images/RasulGuliyev.png" width="330" height="80" id="top_logo"> <br /> <br /> <div class="fade" id="navigation"> <ul> <font face="Verdana, Geneva, sans-serif"> <li> <a href="../../index.html"> ANA S?HIF? </a> </li> <li> <a href="../biographyAZ.html"> BIOQRAFIYA </a> </li> <li style="background-color:#9C1A35;"> <a href="#"> X?B?RL?R V? HADIS?L?R </a> </li> <li> <a> PROQRAM </a> </li> <li> <a> SEÇICIL?R </a> </li> <li> <a> ?LAQ?L?R</a> </li> </font> </ul> </div> <font face="Tahoma, Geneva, sans-serif"> <br /> <div id="navigation2"> <ul> <a> <li><i> HADIS?L?R </i></li> </a> <a> <li><i>VIDEOLAR</i> </li> </a> </ul> </div> <div id="news_section" style="background-color:#FFF;"> <h3 style="font-weight:100; font-size:22px; font-style:normal; color:#7C7C7C;">Son X?b?rl?r</h3> <div class="fade" id="Latest-Stories"> <table id="stories-preview" width="330" height="598" border="0" cellpadding="0" cellspacing="0"> <tr> <td> <a id="link_1" href="#"><img src="../../Images/N&EImages/images/Article-Nav-Bar1_01.gif" width="330" height="114" alt=""></a> </td> </tr> <tr> <td> <a id="link_2" href="#"> <img src="../../Images/N&EImages/images/Article-Nav-Bar1_02.gif" width="330" height="109" alt=""> </a> </td> </tr> <tr> <td> <a id="link_3" href="#"> <img src="../../Images/N&EImages/images/Article-Nav-Bar1_03.gif" width="330" height="132" alt=""></a> </td> </tr> <tr> <td> <a id="link_4" href="#"><img src="../../Images/N&EImages/images/Article-Nav-Bar1_04.gif" width="330" height="124" alt=""></a> </td> </tr> <tr> <td> <a id="link_5" href="#"><img src="../../Images/N&EImages/images/Article-Nav-Bar1_05.gif" width="330" height="119" alt=""></a> </td> </tr> </table> <div class="fade" id="latest_story_main"> <!--START--> <img src="../../Images/N&EImages/GuliyevFace.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> "Bizim V?zif?miz Az?rbaycan Xalqinin T?zyiq? M?ruz Qalmamasini T?min Etm?kdir" </h2> </a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />IYUN 19, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">ACP-nin v? Müqavim?t H?r?katinin lideri, eks-spiker R?sul Quliyev "Yeni Müsavat"a müsahib? verib. O, son vaxtlar ACP-d? bas ver?n kadr d?yisiklikl?ri, bar?sind? dolasan söz-söhb?tl?r v? dig?r m?s?l?l?r? aydinliq g?tirib. Müsahib?ni t?qdim edirik. – Az?rbaycanda siyasi günd?mi ?hat? ed?n m?s?l?l?rd?n biri d? Sülh?ddin ?kb?rin ACP-y? s?dr g?tirilm?sidir. Ideya v? t?s?bbüs kimin idi? – ?vv?ll?r d? qeyd <a href="#"> [...]</a> </p> <!--FIRST STORY END --> </div> <div class="preview" id="latest_story_preview1"> <!--START--> <img src="../../Images/N&EImages/GuliyevFace2.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> "S?xsiyy?ti Alçaldilan Insanlarin Qisasi Amansiz Olur" </h2></a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />IYUN 12, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">R?sul Quliyev: "Az?rbaycanda müxalif?tin görün?n f?aliyy?ti ?halinin hökum?td?n naraziliq potensialini ifad? etmir" Eks-spiker Avropa görüsl?rinin yekunlarini s?rh etdi ACP lideri R?sul Quliyevin Avropa görüsl?ri basa çatib. S?f?rin yekunlari bar?d? R?sul Quliyev eksklüziv olaraq "Yeni Müsavat"a açiqlama verib. Norveçd? keçiril?n görüsl?rd? Açiq C?miyy?t v? Liberal Demokrat partiyalarinin s?drl?ri Sülh?ddin ?kb?r, Fuad ?liyev v? Müqavim?t H?r?kati Avropa <a href="#"> [...]</a> </p> <!--SECOND STORY END --> </div> <div class="preview" id="latest_story_preview2"> <!--START--> <img src="../../Images/N&EImages/GuliyevFace3.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> R?sul Quliyevin Iyunun 4, 2012-ci ild? Bryusseld?ki Görüsl?rl? ?laq?dar Çixisi </h2></a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />IYUN 4, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">Brüssel görüsl?ri – Az?rbaycanda xalqin malini ogurlayan korrupsioner Höküm?t liderl?rinin xarici banklarda olan qara pullari v? ?mlaklarinin dondurulmasina çox qalmayib. Camaatin hüquqlarini pozan polis, prokuratura v? m?hk?m? isçil?rin? v? onlarin r?hb?rl?rin? viza m?hdudiyy?tl?ri qoymaqda reallasacaq. R?sul Quliyevin Iyunun 4, 2012-ci ild? Bryusseld?ki Görüsl?rl? ?laq?dar Çixisi Rasul Guliyev's Speech on June 4, 2012 about Brussels Meetings <a href="#">[...]</a> </p> <!--THIRD STORY END --> </div> <div class="preview" id="latest_story_preview3"> <!--START--> <img src="../../Images/N&EImages/GuliyevGroup1.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> R?sul Quliyevin Avropa Parlamentind? v? Hakimiyy?t Qurumlarinda Görüsl?ri Baslamisdir </h2></a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />MAY 31, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">Aciq C?miyy?t Partiyasinin lideri, eks-spiker R?sul Quliyev Avropa Parlamentind? görüsl?rini davam etdirir. Bu haqda "Yeni Müsavat"a R.Quliyev özü m?lumat verib. O bildirib ki, görüsl?rd? Liberal Demokrat Partiyasinin s?dri Fuad ?liyev v? R.Quliyevin Skandinaviya ölk?l?ri üzr? müsaviri Rauf K?rimov da istirak edirl?r. Eks-spiker deyib ki, bu görüsl?r 2013-cü ild? keçiril?c?k prezident seçkil?rind? saxtalasdirmanin qarsisini almaq planinin [...]</p> <!--FOURTH STORY END --> </div> <div class="preview" id="latest_story_preview4"> <!--START--> <img src="../../Images/N&EImages/GuliyevGroup2.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> Norveçin Oslo S?h?rind? Parlament Üzvl?ri il? v? Xarici Isl?r Nazirliyind? Görüsl?r </h2></a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />MAY 30, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">R?sul Quliyev Norveçin Oslo s?h?rind? Parlament üzvl?ri v? Xarici isl?r nazirliyind? görüsl?r keçirmisdir. Bu görüsl?rd? Az?rbaycandan Liberal Demokrat Partiyasinin s?dri Fuad ?liyev, Avro-Atlantik Surasinin s?dri Sülh?ddin ?kb?r v? Milli Müqavim?t H?r?katinin Skandinaviya ölk?l?ri üzr? nümay?nd?si Rauf K?rimov istirak etmisdir. Siyasil?r ilk ?vv?l mayin 22-d? Norveç Parlamentinin Avropa Surasinda t?msil ed?n nümay?nd? hey?tinin üzvül?ri Karin S. [...]</a> </p> <!--FIFTH STORY END --> </div> <hr /> </div> <!--LATEST STORIES --> <div class="fade" id="article-section"> <h3 style="font-weight:100; font-size:22px; font-style:normal; color:#7C7C7C;">Çecin X?b?rl?r</h3> <div class="older-article"> <img src="../../Images/N&EImages/GuliyevGroup2.jpeg" style="padding:4px; margin-top:6px; border-style:groove; border-width:thin; margin-left:90px;" /> <a href="#"> <h2 style="font-weight:100; font-style:normal;"> Norveçin Oslo S?h?rind? Parlament Üzvl?ri il? v? Xarici Isl?r Nazirliyind? Görüsl?r </h2></a> <h5 style="font-weight:100; font-size:12px; color:#888; opacity:.9;"> <img src="../../Images/ClockImage.png" />MAY 30, 2012 BY RASUL GULIYEV - R?SUL QULIYEV</h5> <p style="font-size:14px; font-style:normal;">R?sul Quliyev Norveçin Oslo s?h?rind? Parlament üzvl?ri v? Xarici isl?r nazirliyind? görüsl?r keçirmisdir. Bu görüsl?rd? Az?rbaycandan Liberal Demokrat Partiyasinin s?dri Fuad ?liyev, Avro-Atlantik Surasinin s?dri Sülh?ddin ?kb?r v? Milli Müqavim?t H?r?katinin Skandinaviya ölk?l?ri üzr? nümay?nd?si Rauf K?rimov istirak etmisdir. Siyasil?r ilk ?vv?l mayin 22-d? Norveç Parlamentinin Avropa Surasinda t?msil ed?n nümay?nd? hey?tinin üzvül?ri Karin S. [...]</a> </p> </div> <hr /> </div> <!--NEWS SECTION--> </font> <h3 class="fade" id="footer">Rasul Guliyev 2012</h3> </div> </body> </head> </html>

    Read the article

  • Swiping Images with Page Control in Iphone

    - by lakesh
    I am trying to make practice app where i can scroll images with page control. I am able to scroll images and able to include the page control. But the problem i face is i am not able to interlink the two. Meaning to say when I scroll the images, the page control is not affected and when i change the page control, the scrolling of the images is unaffected. I have referred to this: http://www.iosdevnotes.com/2011/03/uiscrollview-paging/ for the scrolling with page control. Viewcontroller.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController <UIScrollViewDelegate>{ UIScrollView *scrollView; UIPageControl *pageControl; BOOL pageControlBeingUsed; } @property (nonatomic, retain) IBOutlet UIScrollView *scrollView; @property (nonatomic, retain) IBOutlet UIPageControl *pageControl; - (IBAction)changePage; @end Viewcontroller.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize scrollView,pageControl; - (void)viewDidLoad { [super viewDidLoad]; NSArray *images = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"1.jpeg"],[UIImage imageNamed:@"2.jpeg"],[UIImage imageNamed:@"3.jpeg" ], nil]; self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * images.count, self.scrollView.frame.size.height); for (int i = 0; i < images.count; i++) { CGRect frame; frame.origin.x = self.scrollView.frame.size.width * i; frame.origin.y = 0; frame.size = self.scrollView.frame.size; UIImageView* imgView = [[UIImageView alloc] init]; imgView.image = [images objectAtIndex:i]; imgView.frame = frame; [scrollView addSubview:imgView]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; self.scrollView = nil; } - (void)scrollViewDidScroll:(UIScrollView *)sender { // Update the page when more than 50% of the previous/next page is visible CGFloat pageWidth = self.scrollView.frame.size.width; int page = floor((self.scrollView.contentOffset.x - pageWidth / 2) / pageWidth) + 1; self.pageControl.currentPage = page; } - (IBAction)changePage{ // update the scroll view to the appropriate page CGRect frame; frame.origin.x = self.scrollView.frame.size.width * self.pageControl.currentPage; frame.origin.y = 0; frame.size = self.scrollView.frame.size; [self.scrollView scrollRectToVisible:frame animated:YES]; pageControlBeingUsed = YES; } - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { pageControlBeingUsed = NO; } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView { pageControlBeingUsed = NO; } @end Need some guidance on this... Thanks..

    Read the article

  • If/else isn't working properly

    - by luckytaxi
    I have a validation function I'm using inside of codeigniter. function valid_image() { if ( ($_FILES["file"]["type"] != "image/jpeg") || ($_FILES["file"]["type"] != "image/gif") ) { $this->form_validation->set_message('valid_image', 'Wrong file type..'); return false; } else { return true; } With just the "image/jpeg" part in the if statement it works fine. If I try to upload anything other than a jpg file it fails. If I run the code above, it fails with both a jpg or a gif file. And before someone says "why not use the upload class," I can't. I'm saving my pics directly into MongoDB, so the upload class doesn't help much.

    Read the article

  • How to convert *.aspx (HTML) page to Image format

    - by Swapnil Fegade
    I want to convert *.aspx (HTML) page's (User Interface) to Image such as JPEG. I am using below code for that Protected Sub btnGet_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGet.Click saveURLToImage("http://google.co.in") End Sub Private Sub saveURLToImage(ByVal url As String) If Not String.IsNullOrEmpty(url) Then Dim content As String = "" Dim webRequest__1 As System.Net.WebRequest = WebRequest.Create(url) Dim webResponse As System.Net.WebResponse = webRequest__1.GetResponse() Dim sr As System.IO.StreamReader = New StreamReader(webResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("UTF-8")) content = sr.ReadToEnd() 'save to file Dim b As Byte() = Convert.FromBase64String(content) Dim ms As New System.IO.MemoryStream(b, 0, b.Length) Dim img As System.Drawing.Image = System.Drawing.Image.FromStream(ms) img.Save("c:\pic.jpg", System.Drawing.Imaging.ImageFormat.Jpeg) img.Dispose() ms.Close() End If End Sub But I am getting Error as "Invalid character in a Base-64 string" at line Dim b As Byte() = Convert.FromBase64String(content)

    Read the article

  • css border problem

    - by Chris
    For some reason I have a very ugly orange part of a border around a image. Can anyone see why this is? This is the HTML <div class="preview"> <a href="images/foto/full/280899624_6_5_j6.jpeg" title="Sportschool Raymond Snel" rel="lightbox"><img src="images/foto/full/280899624_6_5_j6.jpeg" alt="text" /></a> </div> This is the css .preview { width: 85px; height: 85px; overflow: hidden; border: 3px solid #2e2a26; } The color code = FF6a00 but appears only one time in the css file. a { color: #ff6a00; text-decoration: none; border: 0px; } As you can see I already gave it a 0px, but for some reason the border is still there.

    Read the article

  • UIButton's Custom image and frame

    - by Joo Park
    I have the following code. UIImage *cancelImg = [UIImage imageNamed:@"cancel.jpeg"]; UIButton *btnCancel = [UIButton buttonWithType:UIButtonTypeCustom]; btnCancel.userInteractionEnabled = YES; [btnCancel setFrame:CGRectMake(0.0,0.0, 28.0, 28.0)]; [btnCancel setImage:cancelImg forState:UIControlStateNormal]; cell.accessoryView = btnCancel; cancel.jpeg currently is bigger than 28 x 28 and it's actually 100 x 100. Why does the button display 100 x 100 size of the image when I've set the UIButton's size to 28 x 28?

    Read the article

  • A Python Wrapper for Shutterfly. Uploading an Image

    - by iJames
    I'm working on a Django app in which I want to order prints through Shutterfly's Open API: http://www.shutterfly.com/documentation/start.sfly So far I've been able to build the appropriate POSTs and GETs using the modules and suggested code snippets including httplib, httplib2, urllib, urllib2, mimetype, etc. But I'm stuck on the image uploading when placing an order (the ordering process is not the same process as uploading images to albums which I haven't tried.) From what I can tell, I'm supposed to basically create the multipart form data by concatenating the HTTP request body together with the binary data of the image. I take the strings: --myuniqueboundary1273149960.175.1 Content-Disposition: form-data; name="AuthenticationID" auniqueauthenticationid --myuniqueboundary1273149960.175.1 Content-Disposition: file; name="Image.Data"; filename="1_41_orig.jpg" Content-Type: image/jpeg and I put this data into it and end with the final boundary: ...\xb5|\xf88\x1dj\t@\xd9\'\x1f\xc6j\x88{\x8a\xc0\x18\x8eGaJG\x03\xe9J-\xd8\x96[\x91T\xc3\x0eTu\xf4\xaa\xa5Ty\x80\x01\x8c\x9f\xe9Z\xad\x8cg\xba# g\x18\xe2\xaa:\x829\x02\xb4["\x17Q\xe7\x801\xea?\xad7j\xfd\xa2\xdf\x81\xd2\x84D\xb6)\xa8\xcb\xc8O\\\x9a\xaf(\x1cqM\x98\x8d*\xb8\'h\xc8+\x8e:u\xaa\xf3*\x9b\x95\x05F8\xedN%\xcb\xe1B2\xa9~Tw\xedF\xc4\xfe\xe8\xfc\xa9\x983\xff\xd9... That ends up making it look like this (when I use print to debug): ... --myuniqueboundary1273149960.175.1 Content-Disposition: file; name="Image.Data"; filename="1_41_orig.jpg" Content-Type: image/jpeg ????q?ExifMM* ? ??(1?2?<??i?b?NIKON CORPORATIONNIKON D40HHQuickTime 7.62009:02:17 13:05:25Mac OS X 10.5.6%??????"?'??0220?????? ???? ? ?|_???,b???50??5 ... --myuniqueboundary1273149960.175.1-- My code for grabbing the binary data is pretty much this: filedata = open('myjpegfile.jpeg','rb').read() Which I then add to the rest of the body. I've see something like this code everywhere. I'm then using this to post the full request (with the headers too): response = urllib2.urlopen(request).read() This seems to me to be the standard way that form POSTS with files happens. Am I missing something here? At some point I might be able to make this into a library worth posting up on github, but this problem has stopped me cold in my tracks. Thanks for any insight!

    Read the article

  • image upload problem.

    - by Bluemagica
    I wrote a function to resize and upload images...it works, but only for one image. So if I call the function three times, I end up with 3 copies of the last image..... function uploadImage($name,$width,$height,$size,$path='content/user_avatars/') { //=================================================== //Handle image upload $upload_error=0; //Picture $img = $_FILES[$name]['name']; if($img) { $file = stripslashes($_FILES[$name]['name']); $ext = strtolower(getExt($file)); if($ext!='jpg' && $ext!='jpeg' && $ext!='png' && $ext!='gif') { $error_msg = "Unknown extension"; $upload_error = 1; return array($upload_error,$error_msg); } if(filesize($_FILES[$name]['tmp_name'])>$size*1024) { $error_msg = "Max file size of ".($size*1024)."kb exceeded"; $upload_error = 2; return array($upload_error,$error_msg); } $newFile = time().'.'.$ext; resizeImg($_FILES[$name]['tmp_name'],$ext,$width,$height); $store = copy($_FILES[$name]['tmp_name'],$path.$newFile); if(!$store) { $error_msg = "Uploading failed"; $upload_error = 3; return array($upload_error,$error_msg); } else { return array($upload_error,$newFile); } } } //========================================================================================= //Helper Functions function getExt($str) { $i = strpos($str,"."); if(!$i) { return ""; } $l = strlen($str)-$i; $ext = substr($str,$i+1,$l); return $ext; } function resizeImg($file,$ext,$width,$height) { list($aw,$ah) = getimagesize($file); $scaleX = $aw/$width; $scaleY = $ah/$height; if($scaleX>$scaleY) { $nw = round($aw*(1/$scaleX)); $nh = round($ah*(1/$scaleX)); } else { $nw = round($aw*(1/$scaleY)); $nh = round($ah*(1/$scaleY)); } $new_image = imagecreatetruecolor($nw,$nh); imagefill($new_image,0,0,imagecolorallocatealpha($new_image,255,255,255,127)); if($ext=='jpg'||$ext=='jpeg') { $src_image = imagecreatefromjpeg($file); } else if($ext=='gif') { $src_image = imagecreatefromgif($file); } else if($ext=='png') { $src_image = imagecreatefrompng($file); } imagecopyresampled($new_image,$src_image,0,0,0,0,$nw,$nh,$aw,$ah); if($ext=='jpg'||$ext=='jpeg') { imagejpeg($new_image,$file,100); } else if($ext=='gif') { imagegif($new_image,$file); } else if($ext=='png') { imagepng($new_image,$file,9); } imagedestroy($src_image); imagedestroy($new_image); } I have a form with two upload fields, 'face_pic' and 'body_pic', and I want to upload these two to the server and resize them before storing. Any ideas?

    Read the article

  • Sort and display directory list alphabetically using opendir() in php

    - by felixthehat
    Hi there, php noob here - I've cobbled together this script to display a list of images from a folder with opendir, but I can't work out how (or where) to sort the array alphabetically <?php // opens images folder if ($handle = opendir('Images')) { while (false !== ($file = readdir($handle))) { // strips files extensions $crap = array(".jpg", ".jpeg", ".JPG", ".JPEG", ".png", ".PNG", ".gif", ".GIF", ".bmp", ".BMP", "_", "-"); $newstring = str_replace($crap, " ", $file ); //asort($file, SORT_NUMERIC); - doesnt work :( // hides folders, writes out ul of images and thumbnails from two folders if ($file != "." && $file != ".." && $file != "index.php" && $file != "Thumbnails") { echo "<li><a href=\"Images/$file\" class=\"thickbox\" rel=\"gallery\" title=\"$newstring\"><img src=\"Images/Thumbnails/$file\" alt=\"$newstring\" width=\"300\" </a></li>\n";} } closedir($handle); } ?> Any advice or pointers would be much appreciated!

    Read the article

  • Drupal 6: display image with View in blog posts listing page...

    - by artmania
    Hi friends, I'm new at Drupal, love it so far :) I added Photo and Logo File field to blog entry with CCK. I need to display these images at blog post listing page. So at View Module, I added fields as below; At View: Content: Logo URL to file Content: Photo Path to file and it displays only names of files, but I need to display image. how can I make it with View Module? Blog Listing Page: Logo: http://blabla.com/drupal/sites/default/files/Logo_0.jpeg Photo: sites/default/files/photoname_0.jpeg Appreciate helps!!!! Thanks a lot!

    Read the article

  • image loading information with jquery

    - by Pradyut Bhattacharya
    Hi I have a page which has a img holder with the html: - <img src="someimage.jpeg" alt="image" class="show_image"/> Now i m updating the image with jquery using the code... $('.show_image').attr('src', 'anotherimage.jpeg'); Now its working fine but i want to show the users the image is being loaded and may wait as the image size may be huge... Is there any method in jquery to get the information of percent loaded(bytes read/remaining) or if the image load is complete... Also how can i place a div over the image placeholder such that the div can fade the image(opacity:0.8) and add some text over the div as loading or something thanks

    Read the article

  • How do I remove (or apply) transparency on a gdk-pixbuf?

    - by Andrew Stacey
    I have a c++ program in which a gdk-pixbuf is created. I want to output it as an image, so I call gdk_pixbuf_save_to_stream(pixbuf,stream,type,NULL,&err,NULL). This works fine when "type" is png or tiff, but with jpeg or bmp it just produces a black square. The original pixbuf consists of black-on-transparent (and gdk_pixbuf_get_has_alpha returns true) so I'm guessing that the problem is with the alpha mask. GdkPixbuf has a function to add an alpha channel, but I can't see one that removes it again, or (which might be as good) to invert it. Is there a simple way to get the jpeg and bmp formats to work properly? (I should say that I'm very new to proper programming like this.)

    Read the article

  • Using Delphi or FFMpeg to create a movie from image sequence

    - by Hein du Plessis
    Hi all My Delphi app has created a squence called frame_001.png to frame_100.png. I need that to be compiled into a movie clip. I think perhaps the easiest is to call ffmpeg from the command line, according to their documentation: For creating a video from many images: ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi The syntax foo-%03d.jpeg specifies to use a decimal number composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable. From: http://ffmpeg.org/ffmpeg-doc.html#SEC5 However my files are (lossless) png format, so I have to convert using imagemagick first. My command line is now: ffmpeg.exe -f image2 -i c:\temp\wentelreader\frame_%05d.jpg -r 12 foo.avi But then I get the error: [image2 @ 0x133a7d0]Could not find codec parameters (Video: mjpeg) c:\temp\wentelreader\Frame_C:\VID2EVA\Tools\Mencoder\wentel.bat5d.jpg: could not find codec parameters What am I doing wrong? Alternatively can this be done easily with Delphi?

    Read the article

  • OpenCV to use in memory buffers or file pointers

    - by The Unknown
    The two functions in openCV cvLoadImage and cvSaveImage accept file path's as arguments. For example, when saving a image it's cvSaveImage("/tmp/output.jpg", dstIpl) and it writes on the disk. Is there any way to feed this a buffer already in memory? So instead of a disk write, the output image will be in memory. I would also like to know this for both cvSaveImage and cvLoadImage (read and write to memory buffers). Thanks! My goal is to store the Encoded (jpeg) version of the file in Memory. Same goes to cvLoadImage, I want to load a jpeg that's in memory in to the IplImage format.

    Read the article

  • Can a user-chosen image be inserted directly into a JEditorPane?

    - by JIM
    What I am trying to do is open up a JFilechooser that filters jpeg,gif and png images, then gets the user's selection and inserts it into the JEditorPane. Can this be done? or am i attempting something impossible? Here is a sample of my program.(insert is a JMenuItem and mainText is a JEditorPane) insert.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ JFileChooser imageChooser = new JFileChooser(); imageChooser.setFileFilter(new FileNameExtensionFilter("Image Format","jpg","jpeg","gif","png")); int choice = imageChooser.showOpenDialog(mainText); if (choice == JFileChooser.APPROVE_OPTION) { mainText.add(imageChooser.getSelectedFile()); } } }); What i tried to do is use the add method, i know it's wrong but just to give you an idea of what i'm trying to do. Before you complain, i'm sorry about the code formatting, i don't really know all the conventions of what is considered good or bad style. Thank you very much.

    Read the article

  • Is there a decent vector / spline library for php?

    - by Brendan Heywood
    Does anyone know of the best way to render clean vectors into a php image and then serve it as a jpeg/png? Specifically I want to draw lines, polygons and splines which are anti-aliased and then serve them up as jpegs. Preferably also with an alpha option when rendering. What would be spectacular is a php library with a similar API to Raphael (without the animation) - not only because Raphael has a great API but also because I'm already using it on my website for the dynamic bits but also need to bake jpeg's in parallel for static consumption.

    Read the article

  • How to match multiple lines with Regex in C#?

    - by Emanuel
    I have the following text: --------------030805090908050805080502 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <[email protected]> /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA QBQH/9k= --------------030805090908050805080502 Content-Type: image/jpeg Content-Transfer-Encoding: base64 Content-ID: <[email protected]> /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAARgAA/+4ADkFkb2JlAGTAAAAA juu41lRHFLufPCAID//Z --------------030805090908050805080502-- And I need to get with Regex in C# 2 parts: between the first and the second occurence of the string "--------------030805090908050805080502" between the strings "--------------030805090908050805080502" and "--------------030805090908050805080502--" I tried this regex: --------------030805090908050805080502(\r.*)*--------------030805090908050805080502 but in C# regex.Matches(...) return only "--------------030805090908050805080502". Any idee? Thanks.

    Read the article

  • Add Access-Control-Allow-Origin to header in PHP

    - by SANDeveloper
    I am trying to workaround CORS restriction on a WebGL application. I have a Web Service which resolves URL and returns images. Since this web service is not CORS enabled, I can't use the returned images as textures. I was planning to: Write a PHP script to handle image requests Image requests would be sent through the query string as a url parameter The PHP Script will: Call the web service with the query string url Fetch the image response (web service returns a content-type:image response) Add the CORS header (Add Access-Control-Allow-Origin) to the response Send the response to the browser I tried to implement this using a variety of techniques including CURL, HTTPResponse, plain var_dump etc. but got stuck at some point in each. So I have 2 questions: Is the approach good enough? Considering the approach is good enough: I made the most progress with CURL. I could get the image header and data with: $ch = curl_init(); $url = $_GET["url"]; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:image/jpeg')); //Execute request $response = curl_exec($ch); //get the default response headers $headers = curl_getinfo($ch); //close connection curl_close($ch); But this doesn't actually change set the response content-type to image/jpeg. It dumps the header + response into a new response of content-type text/html and display the header and the image BLOB data in the browser. How do I get it to send the response in the format I want? Managed to get it working: $ch = curl_init(); $url = $_GET["url"]; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); //Execute request $response = curl_exec($ch); //get the default response headers $headers = curl_getinfo($ch); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); header('Content-Type: image/jpeg'); header("Access-Control-Allow-Origin: *"); // header("Expires: Sat, 26 Jul 2017 05:00:00 GMT"); //close connection curl_close($ch); flush();

    Read the article

  • Convert jpg Byte[] to Texture2D

    - by Damien Sawyer
    I need to import jpeg images into a WP7/XNA app with associated metadata. The program which manages these images exports to an XML file with an encoded byte[] of the jpg files. I've written a custom importer/processor which successfully imports the reserialized objects into my XNA project. My question is, given the byte[] of the jpg, what is the best way to convert it back to Texture2D. // 'Standard' method for importing image Texture2D texture1 = Content.Load<Texture2D>("artwork"); // Uses the standard Content processor "Texture - XNA Framework" to import an image. // 'Custom' method var myCustomObject = Content.Load<CompiledBNBImage>("gamedata"); // Uses my custom content Processor to return POCO "CompiledBNBImage" byte[] myJPEGByteArray = myCustomObject.Image; // byte[] of jpeg Texture2D texture2 = ???? // What is the best way to convert myJPEGByteArray to a Texture2D? Thanks very much for your help. :-) DS

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >