w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to extract image orientation information from image loaded in Canvas
Prerequisites There is of course a dependency here on the device that takes the picture that it actually has a sensor that can tell orientation. Some cameras do others don't. And even if it does have a sensor there is no guarantee EXIF will be embedded in the image. EXIF is not embedded for PNG for example and some upload JPEG images where EXIF is removed for privacy and/or size reasons (eg. GPS coordinates etc.). Photoshop will remove EXIF if saved out using its "Save for web" option. Try different EXIF components There is also the possibility that the EXIF component you are using has a bug. Try other EXIF readers out there as well to eliminate this: code.flickr.com ExifReader exif-js (and there are a ton of others). Detecting "raw" orientation In case you only have an "raw" ima

Categories : Javascript

Visualizing 3D information over a 2D image
This function does an amazing job. http://www.mathworks.com/matlabcentral/fileexchange/27994-inpaint-over-missing-data-in-1-d-2-d-3-d-n-d-arrays I am looking for some other alternatives and things people have done if available! Thanks.

Categories : Matlab

Clearing image and draw information on it
One possibility is to create a temporary bitmap, based on the original one, for each cycle. Please not that I made your Graphics instance be disposed immediately when no longer needed (by means of the using clause) and note that the Graphics instance is build on top of the newBitmap not of the original one. Also make sure that you consume the newBitmap reference, at the end of the cycle instead of the bmp reference which simply holds the original background. Bitmap bmp = new Bitmap(@"G:Cert_template.png"); for ( ... ) { Bitmap newBitmap = new Bitmap(bmp); using (Graphics g = Graphics.FromImage(newBitmap)) { // somehow alter cert_id, date_cert, etc... g.DrawString(cert_id, new Font("B Zar", 3,System.Drawing.FontStyle.Bold), Brushes.Black, new Point(85, 95)); g.Draw

Categories : C#

Some information need to be displayed above the background image
Use setalpha method to the imageview and make the appearance dull. set alpha below api level 8 AlphaAnimation anim = new AlphaAnimation(0.4f, 0.4f); anim.setDuration(50); anim.setFillEnabled(true); anim.setFillAfter(true); <view>.startAnimation(anim);

Categories : Android

Android OpenCV FeatureDetection -> runFeatureHomography giving messed up result image after matching
Alright, found a working way: Imgproc.cvtColor(img_object, img_object, Imgproc.COLOR_RGBA2RGB); Imgproc.cvtColor(img_scene, img_scene, Imgproc.COLOR_RGBA2RGB); It seems that after i converted my Bitmaps to Mats i have to use the above two lines to convert them from RGBA to RGB. It also works with RGBA to GRAY if you prefer gray pictures. It seems that RGBA format is not working in this case. Hope this helps anybody coming here from google.

Categories : Android

show detail information when click an image with php
I think that you should use Jquery for this. Here is a link. I gotta go to sleep now, but if you don`t have it done by tomorrow, I will help you! Hope the jquery link helps you though!

Categories : PHP

Extracting information from the largest rectangle in an image using openCV in Android
Instead of drawing it on the imgSource matrix: Imgproc.drawContours(imgSource, largest_contours, -1, new Scalar(0, 255, 0), 1); Create an empty black/white Mat and draw on it. Something like this (black initial matrix): emptyMat = Mat.zeros(imgSource.size(), imgSource.channels()); ... Imgproc.drawContours(emptyMat, largest_contours, -1, new Scalar(0, 255, 0), 1); Of course, you can use the Mat constructor for creating the initial background matrix you want.

Categories : Android

Drupal 7, iPhone image orientation messed up - no exif information
You are not seeing things. iPhone/Pad strip the EXIF info when they send the image. Image upload from iphone strips exif data The EXIF Custom Module may be of help. https://drupal.org/project/exif_custom So might ImageCache Actions https://drupal.org/project/imagecache_actions

Categories : Iphone

can caching information attached to image file names cause a 404 error?
you should use asset helpers provided by rails which would automagically create the right url to the image with caching build in. here is how: .qb{ position: absolute; width: 50px; height: 50px; background-image: url( <%= asset_path 'qb.png' %> ); left: 75px; top: 300px; } the above will map qb.png to qb-0bb3f134943971c95b2abdfd30f932c7.png & also update the url once the caching fingerprint changes. just make sure that your stylesheet filename has .erb at the end, something like stylesheet.css.erb see The Asset Pipeline guide for more information [edit] For Bootstrap integration with rails asset pipeline, kindly use gem like bootstrap-sass. it will fix your issues with images

Categories : Ruby On Rails

Want to optimize code for captured image resize and rotate using canvas of html5, which now giving low memory warning on mobile
Try using MediaDevices.getUserMedia() (documentation) for browsers which support it, you don't need to resize the photo as you can request the size of the photo. Several examples: http://www.html5rocks.com/en/tutorials/getusermedia/intro/ https://github.com/addyosmani/getUserMedia.js

Categories : Javascript

Curser returns null when trying to access image content information (Rotation)
Yes, they key was that the uri returned was not of the format content://.. which told me that the image had not been added to the mediastore, so of course the cursor was null. Solution was to change Intent creation such as this. protected void openImageIntent() { final String fname = "img_" + System.currentTimeMillis() + ".jpg"; ContentValues values = new ContentValues(); values.put(MediaStore.Images.Media.TITLE, fname); values.put(MediaStore.Images.Media.DESCRIPTION, "Image capture by camera"); // outputFileUri is the current activity attribute, define and save it // for later usage (also in onSaveInstanceState) outputFileUri = getContentResolver().insert( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); // Camera. fi

Categories : Android

VBA to Copy Information From a Folder of Files and Compile Information to a Single Workbook
This is not the full code, but it should help you. When you work with multiple workbooks keep track of them. For example start with: Dim CurrWB As Workbook Set CurrWB = ActiveWorkbook Then in the cycle: Dim WB As Workbook For Each StrFile In var Set WB = Workbooks.Open(loc & StrFile) ... WB.Close Next StrFile Inside the cycle you can find the area to copy doing something like: R1 = 1 Do While WB.Sheets("Sheet name").Cells(R, 2) <> "Starting text" R1 = R1 + 1 Loop R2 = R1 + 1 Do While WB.Sheets("Sheet name").Cells(R2, 2) <> "Ending text" R = R + 1 Loop For R = R1 to R2 CurrWB.Sheets("Report").Cells(RReport, 3) = WB.Sheets("Report").Cells(R, 3) RReport = RReport + 1 Next R

Categories : Excel

Reply mail structure information: how to retrieve sent and received information
There's no standard for the structure of a reply email. It's not usually done using multipart email, it just uses human-readable text, often with > prefixes to denote quoted text. This allows replies to be interspersed inline with the quoted material. The only standard features of replies are a couple of headers: In-Reply-To: <ID> and References: <ID1>, <ID2>, <ID3>, ... In-Reply-To contains the message ID of the message that was replied to. References is a growing list of message IDs -- when you reply, you take the original message's reference list and append the ID of the message being replied to at the end. See RFC 5322 for more details about these headers.

Categories : PHP

how to get the information of about database events and actor information
Look at the MODULE, ACTION and CLIENT_INFO columns of V$SESSION. Then, in the package(s) and/or trigger(s) you suspect are performing the update, call DBMS_APPLICATION_INFO.SET_MODULE and DBMS_APPLICATION_INFO.SET_ACTION: BEGIN DBMS_APPLICATION_INFO.SET_MODULE(trigger_name, 'trigger start'); -- some code... DBMS_APPLICATION_INFO.SET_ACTION('updating employee'); -- code which updates the employee table DBMS_APPLICATION_INFO.SET_ACTION('doing something else'); -- more code... DBMS_APPLICATION_INFO.SET_MODULE(NULL, NULL); END; See also the example provided in the usage notes.

Categories : Oracle

Storing and Retrieving Image Path From android application folder On Pre Created SQLite Database & Setting the image to Image View
I would only save the image name in the db and then get the resource identifier with context.getResources().getIdentifier(). Check out this similar question.

Categories : Android

How to get image from an Image Control Type in .net c#, I need to save this image in a file and then use it for later comparing
Previewing Image in ASP.NET Image Control using C# help you to get image from an Image Control Type. You can save the image in the below way. Image bitmap = Image.FromFile("C:\MyFile.bmp"); bitmap.Save("C:\MyFile2.bmp"); You should be able to use the Save Method from the Image Class and be just fine as shown above. The Save Method has 5 different options or overloads. //Saves this Image to the specified file or stream. img.Save(filePath); //Saves this image to the specified stream in the specified format. img.Save(Stream, ImageFormat); //Saves this Image to the specified file in the specified format. img.Save(String, ImageFormat); //Saves this image to the specified stream, with the specified encoder and image encoder parameters. img.Save(Stream, ImageCodecInfo, E

Categories : Dotnet

I am using CIFilter to get a blur image,but why is the output image always larger than input image?
This is a super late answer to your question, but the main problem is you're thinking of a CIImage as an image. It is not, it is a "recipe" for an image. So, when you apply the blur filter to it, Core Image calculates that to show every last pixel of your blur you would need a larger canvas. That estimated size to draw the entire image is called the "extent". In essence, every pixel is getting "fatter", which means that the final extent will be bigger than the original canvas. It is up to you to determine which part of the extent is useful to your drawing routine.

Categories : IOS

php image uplaod show default image when image has not been uploaded
you could use file_exists(), like if( !empty($row['article_image']) AND file_exists(YOUR_PATH . $row['article_image']) ) { //show your image from db } else { //show your default image }

Categories : PHP

How to convert image in to binary image using Image processing with Emgu CV
You can transform image into binary by converting it to grayscale and then apllying threshold after that: var bwImage = colorImg.Convert<Gray, byte>().ThresholdBinary(new Gray(yourThrehold), new Gray(255)); if you have small blobs (salt and pepper noise) you can use median filter -function Median or erode the image (function Erode and that dilating it - funcrtion Dilate)

Categories : C#

reduce is not giving right sum
By default, reduce starts out with the first two items in the list, so s will be the first item in the array and entry will be the second item the first time your function is called. Give it a value to start with: var s = _.reduce(groupBy.Food, function(s, entry) { return s + parseFloat(entry.amount); }, 0); (Array’s reduce behaves the same way.)

Categories : Javascript

Php tag giving me error
You can't use HTML inside PHP like this. HTML is not a part of PHP syntax. My index.php page works but when I do view source, I can view the whole exact code of the page, it's not incripted or protected. So I thought well, this is what php is for PHP is not intended, nor can it be used, to hide HTML source code from the browser. The browser needs this code to be able to render the webpage. PHP is a language in which you can program a great deal of things. Popular uses are pulling data from databases and presenting information based on dynamically generated stuff. However, mostly the output in a web application context is still pure (x)HTML code. The browser needs this to display stuff - it's all it understands.

Categories : PHP

Giving Print Job Using PHP
You can read some helpful comments put on similar questions available at PHP to Zebra Printer Printing to printers in PHP Print directly to network printer using php Additionally you can browse to http://php.net/manual/en/book.printer.php for printing support and function in PHP. Hope it helps

Categories : PHP

Giving each data set a name
First off, you should really look into geopy.distance as well as a lot of its other built in capabilities. Yes you already wrote one of their algorithms and such, but it will probably have other things you will find you need. So you are going to want to use a dictionary here. If you can save the latitude and longitude of a station attached to the station, it will make your life very very easy! points = [[row[3],row[4]] for row in dL] stations = [row[1] for row in dL] my_dict = dict(zip(stations,points)) now that you have a dictionary you can call your latitudes and longitudes by station name and store it in such a way that you can just recall later. I think that is all you need in order to finish your code. If it is not, please comment so I can edit it accordingly.

Categories : Python

.val is not giving me the value of my element
Try attaching a keyup event handler This will fire when ever the user releases the key. $('#search').keyup(function() { console.log(this.value) }).change(); If you want to fire the same on document ready then you can just chain the event after the declaration. $(document).ready(function () { $('#search').keyup(function () { //reddit API URL //var URL = "http://www.reddit.com/r/subreddits/search.json?q=Xbox"; var SEARCH_URL = 'http://www.reddit.com/r/subreddits/search.json?jsonp=?'; var searchQueryText = this.value; // or $(this).val(() $.getJSON(SEARCH_URL, { q: searchQueryText, limit: 10 }).done(function (data) { $.each(data.data.children, function (i, item) { $("<p>

Categories : Jquery

SHA-1 not giving the same answer
You can use this Code for getting SHA-1 value. public class sha1Calculate { public static void main(String[] args)throws Exception { File file = new File("D:\Android Links.txt"); String outputTxt= ""; String hashcode = null; try { FileInputStream input = new FileInputStream(file); ByteArrayOutputStream output = new ByteArrayOutputStream (); byte [] buffer = new byte [65536]; int l; while ((l = input.read (buffer)) > 0) output.write (buffer, 0, l); input.close (); output.close (); byte [] data = output.toByteArray (); MessageDigest digest = MessageD

Categories : Misc

Javascript giving NaN error
<script type="text/javascript"> function minus() { var t = parseInt(document.getElementById("totalcost").value, 10), u = parseInt(document.getElementById("advpay").value, 10), set = (t - u); document.getElementById("textfield").value = set; return true; } </script> This is happening because you are trying to subtract two strings! value returns the string of the input, you need to parse it to a number in order to subtract them. Remember to specify radix of parseInt, otherwise the number could be parsed not as a decimal. See this answer for more detailed informations.

Categories : Javascript

DialogFragment giving NullPointerException
Change (new mDialogFragment()).onCreateDialog(null).show(); //this line giving error to mDialogFragment dialog = new mDialogFragment(); dialog.show(getFragmentManager(), "mDialogFragment");

Categories : Android

Dictionary giving improper value
Tried NSMutableDictionary *temp=[[NSMutableDictionary alloc]init]; [temp setObject:@"marinieres" forKey:@"lang_name"]; NSString *name = [temp objectForKey:@"lang_name"]; NSLog(@"item_name =%@",name); NSLog(@"value in dictionary=%@",temp); and what my log shows 2013-06-06 12:38:02.337 Cool[96423:11303] item_name =marinieres 2013-06-06 12:38:04.022 Cool[96423:11303] value in dictionary={ "lang_name" = marinieres; } 1 Quick question: if it is an NSDictionary why you creating a new instance? NSMutableDictionary *temp=[[NSMutableDictionary alloc] initWithDictionary:tempLangItem]; try with tempLangItem

Categories : IOS

Code giving me an ArgumentExeption?
The problem is that the destination file path ends with a "" value. This isn't legal for the CopyFile API. Switch it to include the file name and this should fix the problem My.Computer.FileSystem.CopyFile( _ "ConfigOEMNokiaHTC.js", _ destinationFileName:="C:Users" + user + "DocumentsFiddler2ScriptsNokiaHTC.js")

Categories : Wpf

php isn't giving any error in output
Set your php.ini settings to display errors : - error_reporting to E_ALL - display_errors to on (those are developement environment settings of course ; more about error_reporting levels here) You can find your php.ini location using phpinfo() in a PHP script. EDIT In case it isn't that, try to execute a valid script, and tell us if it runs correctly. If it doesn't, it probably means that your php module installation failed somehow. EDIT 2 Restarting Apache will be necessary after editing such parameters.

Categories : PHP

Array sum giving wrong value PHP
mysql_fetch_array by default returns the data from mysql as a numeric and associative array. You are essentially doubling your value by doing this. Change to mysql_fetch_assoc() and see what your result is. http://php.net/manual/en/function.mysql-fetch-array.php

Categories : PHP

WordPress is giving 500 error
You're missing a semi-colon on this row: $data = array("model"=>"Ford") Also, you might want to enable WP_DEBUG - this way you'll see the actual error and not a standard Error 500 message: http://codex.wordpress.org/WP_DEBUG

Categories : Wordpress

Giving parameters to php with RewriteRule
Try using RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)?/(.*) /go.php?p1=$1&p2=$2 Where RewriteCond %{REQUEST_FILENAME} !-f,!-d tell mod_rewrite to apply the rule just to paths not mapped to existing files and directories. See also the official documentation.

Categories : Htaccess

setOnTouchListener() is giving me an error
Use this code: button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(MainActivity.this, "YOUR TEXT", 5000).show(); } });

Categories : Android

VBA code - not giving desired o/p
Try stepping back through the range instead Sub Matching() Dim S1 As Worksheet, S2 As Worksheet, a As Long Set S1 = Sheets("Sheet1") Set S2 = Sheets("Sheet2") For a = 1000 To 1 Step -1 n = Application.Match(S1.Range("A" & a).Value, S2.Range("E1:E25"), 0) If IsError(n) Then S1.Range("A" & a).EntireRow.Delete End If Next a End Sub

Categories : Vba

contains giving faulty results
Your contains method is breaking, because your compareTo method is always returning 0 or positive, no negatives. This means your compareTo is inconsistent. A correct implementation should return 0 if the authors are the same, or positive and negative values when the authors are different. Example (assuming author1 is different than author2): int i = author1.compareTo(author2); // i should be positive or negative int j = author2.compareTo(author1); // j should be the opposite of i Yours will return 1 for both of the above cases, which will make ordered Collections not work as no element is ever smaller. As another example imagine if you had a Binary Tree(an ordered collection) that had the elements [1-10]. If you were searching for the element 5, your binary tree when comparing 5

Categories : Java

setContentView() giving error
Your layout file R.layout.activity_locate_user_in_map is missing, maybe it is on another project or it is in correct project but somehow it can't be resolved, try to clean the project

Categories : Android

os.walk not giving right path
I think the problem is that you're reusing the root variable while you're walking the directory and parsing XML at the same time. After you've parsed one XML file, the root variable became the root element of parse tree, but in next iteration of the loop, you are still using root variable as the directory name.

Categories : Python

Same queries giving error
My only explanation is that the database is set up to expect the month ahead of the day. The second query can be interpreted as Nov-04, 2013 in this format, but the first query would have an error because there is no month number 20.

Categories : SQL

regex not giving all the possible matches
Use this regex (?<=([^aeiou]))a(?=([^aeiou])) .net supports group capture in lookarounds..cheers Your code would be var lst= Regex.Matches(input,regex) .Cast<Match>() .Select(x=>x.Groups[1].Value+"a"+x.Groups[2].Value) .ToList(); Now you can iterate over lst foreach(String s in lst) { s;//required strings }

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.