thumbnails

getting Image ThumbNail in Android

天大地大妈咪最大 提交于 2020-01-11 18:50:17
问题 I need Thumbnail of an image . I only know about the name of image which is stored in SD card . Can anyone help me. 回答1: Try this. final int THUMBSIZE = 64; Bitmap ThumbImage = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(imagePath), THUMBSIZE, THUMBSIZE); Refer this for more details. 回答2: Using MediaStore.Images.Thumbnails you can query and get two kinds of thumbnails: MINI_KIND: 512 x 384 thumbnail MICRO_KIND: 96 x 96 thumbnail. The advantage of using this call is that the

Video thumbnails not refreshing

一曲冷凌霜 提交于 2020-01-06 07:32:13
问题 I am showing all available videos in a gridView on which are in SDCard by using following code. String[] proj= {MediaStore.Video.Media._ID,MediaStore.Video.Media.DATA,MediaStore.Video.Media.DISPLAY_NAME, MediaStore.Video.Media.SIZE }; videocursor = getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); It is working fine... But if i made any changes to videos (i.e rename, delete) above code is not working. It is showing old content only, means not

Laravel FFmpeg error Call to undefined method FFMpeg\FFMpeg::fromDisk()

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 04:06:11
问题 I'm using laravel ffmpeg to create a thumnail fot the video, but when i run the code, it return me Call to undefined method FFMpeg\FFMpeg::fromDisk() I don't know what happen to this error, i'm follow the instruction in github. here is my code. use FFMpeg\FFMpeg; use FFMpeg\FFProbe; $thumbnail_name = md5($request->video_name).'_thumbnail.jpg'; $thumbnail_path = '/assets/' . $request->video_name; FFMpeg::fromDisk('videos') ->open($export_as) ->getFrameFromSeconds(10) ->export() ->toDisk(

How to proportionally size images to fit dimensions of 200px x 150px thumbnail in css?

拟墨画扇 提交于 2020-01-04 05:27:17
问题 I`ve tried a couple of things even using the CSS clip, but not getting it proportionally fit in the thumbnails here http://giantmango.com/arttest2-2510. In CSS, what is the best way and how would I proportionally resize an image to display in dimensions of a 200px (width) x 150 (height) thumbnail? Just checked firebug and for some reason all my img tags are always set to a height of 200 even though I have max-height set to 150... 回答1: Use max-height and max-width. Beware that they are broken

C# Creating thumbnail (low quality and big size problem)

 ̄綄美尐妖づ 提交于 2020-01-04 05:08:20
问题 public void CreateThumbnail(Image img1, Photo photo, string targetDirectoryThumbs) { int newWidth = 700; int newHeight = 700; double ratio = 0; if (img1.Width > img1.Height) { ratio = img1.Width / (double)img1.Height; newHeight = (int)(newHeight / ratio); } else { ratio = img1.Height / (double)img1.Width; newWidth = (int)(newWidth / ratio); } Image bmp1 = img1.GetThumbnailImage(newWidth, newHeight, null, IntPtr.Zero); bmp1.Save(targetDirectoryThumbs + photo.PhotoID + ".jpg"); img1.Dispose();

Saving thumbnails to .thumbnails folder

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 06:21:07
问题 Hi I am trying to save an image to the .thumbnails folder as shown below: bitmap = ThumbnailUtils.extractThumbnail (BitmapFactory.decodeFile(actualImagePath,options), 120, 120); bitmapGenerated = true; File file = new File(Environment.getExternalStorageDirectory() .toString()+"/"+"DCIM/.thumbnails/"+id+".jpg"); boolean bcc =file.createNewFile(); boolean success = bitmap.compress(Bitmap.CompressFormat.PNG,60,new FileOutputStream (file)); The 'id' is actually the id of the particular image that

How to create a custom gallery having images of a particular folder on SD card?

有些话、适合烂在心里 提交于 2020-01-02 09:41:44
问题 I have seen the API demos of android (/ApiDemos/src/com/example/android/apis/view/Gallery1.java) , but they take images from the res folder within the project. I want to create a gallery of the images which are put up in the folder: /mnt/sdcard/Android/data/com.myapp/files/Pictures/ All i could come up was this code, which, i suppose, displays all images. public class ExistingPicGallery extends Activity { private Cursor cursor; private int columnIndex; @Override protected void onCreate(Bundle

How to create a custom gallery having images of a particular folder on SD card?

纵饮孤独 提交于 2020-01-02 09:41:07
问题 I have seen the API demos of android (/ApiDemos/src/com/example/android/apis/view/Gallery1.java) , but they take images from the res folder within the project. I want to create a gallery of the images which are put up in the folder: /mnt/sdcard/Android/data/com.myapp/files/Pictures/ All i could come up was this code, which, i suppose, displays all images. public class ExistingPicGallery extends Activity { private Cursor cursor; private int columnIndex; @Override protected void onCreate(Bundle

How can I display thumbnails from Blob data

对着背影说爱祢 提交于 2020-01-01 19:56:54
问题 I'm new to php and I'm trying to build a photo website. I've managed to get the upload function working properly (send as blob to database and displaying it using custom url). Now, I want to retrieve this blob data and automaticly make a thumbnail for it. Unfortunately I only see the canvas format with a black background with the width and height I specified. Can someone point me in the right direction? get_thumb_function.php: // db_connect include 'databaseconnection.php'; // get id $id = $

What is the better way to create thumbnails from video in PHP?

本秂侑毒 提交于 2020-01-01 19:19:26
问题 I am creating a video broadcasting site, in which i need to know how to create thumbnails from the video. Please Help. Any Suggestions or References will be highly appreciated 回答1: Here's a snippet to grab a frame from the middle of a video. It is old code I have lying around, so I'm sure it could be simplified. Be sure to adjust the ffmpeg path in line 1 to match the location of your install. $output = shell_exec("/usr/local/bin/ffmpeg -i {$path}"); preg_match('/Duration: ([0-9]{2}):([0-9]{2