Posts

Showing posts with the label Image Gallery

Bootstrap 3 CSS Image Caption Overlay

Answer : I think problem is in placement rather then overlay, div.desc is absolute and image is its sibling. So overlay will not follow image it will follow only anchor tag or your div.wrapper . From what I can see is that there is a margin on image or padding in anchor or wrapper. The best solution is to put desc and image in another div with 100% width with 0 padding. <div class="col-sm-4 wrapper"> <a href="#"> <div class="fix"> <img src="images/upload/projects/21/wolf.jpg" class="img-responsive" alt="" /> <div class="desc"> <p class="desc_content">The pack, the basic unit of wolf social life.</p> </div></div> </a> </div> CSS: .fix{width:100%; padding:0px;} For others trying to overlay a caption on an image in Bootstrap, consider using carousel captions. See here: http://www.w3s...

Android Get Real Path By Uri.getPath()

Answer : This is what I do: Uri selectedImageURI = data.getData(); imageFile = new File(getRealPathFromURI(selectedImageURI)); and: private String getRealPathFromURI(Uri contentURI) { String result; Cursor cursor = getContentResolver().query(contentURI, null, null, null, null); if (cursor == null) { // Source is Dropbox or other similar local file path result = contentURI.getPath(); } else { cursor.moveToFirst(); int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA); result = cursor.getString(idx); cursor.close(); } return result; } NOTE: managedQuery() method is deprecated, so I am not using it. Last edit: Improvement. We should close cursor!! Is it really necessary for you to get a physical path? For example, ImageView.setImageURI() and ContentResolver.openInputStream() allow you to access the contents of a file without knowing its real path. @Rene Juuse - above in comments... Thanks ...