thumbnails

Issue displaying thumbnail image in VideoView

China☆狼群 提交于 2019-12-06 02:12:43
I'm using VideoView for a web video, and I also have a bitmap object contains the corresponding thumbnail image. Now how should I set the bitmap to the VideoView for displaying the thumnail? I'm using videoView.setBackgroundDrawable(new BitmapDrawable(getResources(), bitmap)); But then when I play this video, the video doesn't show, instead it always show this static thumbnail image. Any hints would be appreciated. Thanks. VideoView is a subclass of SurfaceView , which has some special behaviors in terms of its display. SurfaceView contents are actually drawn in a window underneath the view

How to correctly use oembed to pull thumbs from youtube

隐身守侯 提交于 2019-12-06 01:17:31
I show a lot of thumbs on my homepage from youtube videos. I was using this function below to grab the thumb from a youtube url which works fast but it doesn't work for url's in the shortned form like youtu.be/JSHDLSKL. function get_youtube_screen_link( $url = '', $type = 'default', $echo = true ) { if( empty( $url ) ) return false; if( !isset( $type ) ) $type = ''; $url = esc_url( $url ); preg_match("|[\\?&]v=([^&#]*)|",$url,$vid_id); if( !isset( $vid_id[1] ) ) return false; $img_server_num = 'i'. rand(1,4); switch( $type ) { case 'large': $img_link = "http://{$img_server_num}.ytimg.com/vi/{

Should I generate each thumbnail dynamically every time it is requested, or store them on image upload? [duplicate]

混江龙づ霸主 提交于 2019-12-06 00:50:26
问题 This question already has answers here : PHP image resize on the fly vs storing resized images (4 answers) Closed 6 years ago . Problem - I wanted to set up an image-uploading feature in my website. But I wanted to show both- the original image and a small thumbnail of the image. Choices - Which way is better - to create a separate image (thumbnail) in a directory when the image is uploaded or to show a smaller version by reducing its height and width in the fixed ratio every time the image

Get thumbnail of any file including SolidWorks on Windows XP/Vista

亡梦爱人 提交于 2019-12-06 00:09:13
问题 There is a lot of build-in ThumbnailProviders inside every installed OS. Due to these providers Windows is able to show Thumbnail of many files. For example Windows Explorer can show content of *.jpg files, but from Solidworks *.sldprt files too (If SolidWorks is installed). But is there any way to get these thumbnails? I´ve tried to manage this using Windows API CodecPack, but I succeeded only on Windows 7. ShellFile shellFile = ShellFile.FromFilePath(filePath); Bitmap shellThumb = shellFile

How can i order by existence of thumbnail in Wordpress? [closed]

两盒软妹~` 提交于 2019-12-06 00:06:56
My client asked me to order the posts by thumbnail, so I need to sort the post first with the thumbnail, then after without the thumbnail. Here is my code: $the_query = new WP_Query(array( 'post_type' => 'veiculos', 'posts_per_page'=> -1, 'meta_key' => '_thumbnail_id', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'tax_query' => array( array( 'taxonomy' => 'categoria-veiculo', 'field' => 'id', 'terms' => 5 ) ) )); But what happens is that when i put the meta_key the post that havent thumbnail dont show. This is an interesting issue. WordPress currently doesn't have a method to get all the

How to use fancybox button helper + fancybox thumbnail helper?

心不动则不痛 提交于 2019-12-05 23:30:52
I need to use both of them simultaniously (fancybox button helper and thumbnail helper) I can only use one of them at a time. These are the examples of each function: http://fancyapps.com/fancybox/#examples Already tried using the two classes: <a class="fancybox-buttons fancybox-thumbs" But it doesn't work... only one at a time, like: <a class="fancybox-buttons" or <a class="fancybox-thumbs" . These are the javascripts of each: /* Button helper. Disable animations, hide close button, change title type and content */ $('.fancybox-buttons').fancybox({ openEffect : 'none', closeEffect : 'none',

How to get facebook video thumbnail from a given video ID using php

无人久伴 提交于 2019-12-05 21:58:43
I want to get thumbnail of facebook videos from a given video ID . I use the preg_match function to get facebook video ID from a given url retrieved from database preg_match("~/videos/(?:t\.\d+/)?(\d+)~i", $value->url, $matches); $video_id = $matches[1]; echo ' <div class="fb-video" data-href="https://www.facebook.com/facebook/videos/'.$video_id.'/"></div>'; I want to posted on website with something like this: <img src="VIDEO_IMAGE.<?php echo $video_id ?>.jpg"> I don't know if it' posssible? ! Your image source is wrong try using <img src="https://graph.facebook.com/VIDEO_ID/picture" />

Removing black bars off video thumbnail

筅森魡賤 提交于 2019-12-05 21:34:34
I have gallery where user can submit Youtube links to videos and server fetches the thumbnail from Youtube automatically. However, lots of videos contain black bars on top and bottom of the image. I know the origin of the black bars, but as i resize thumbnail to square, the black bars interfere with the design. I have tried to analyze pixel color from top to bottom until no black color is found ( imagecolorat() ), but it still leaves some near-black color so the small bars still reside in the image. What can be more effective algorythm to check for? If you want to go by the color, the

Django easy_thumbnails accessing image URLs

烂漫一生 提交于 2019-12-05 21:02:23
Is it possible to access the URLs of easy_thumbs created images? I have a model with an ImageField and a ModelForm to match. # models.py class ModelWithAnImage(models.Model): image = ThumbnailerImageField( upload_to='images', ) Following the documentation I am using signals to generate two thumbs when the image is uploaded. # somewherethatdefinitelygetsloaded.py from easy_thumbnails.signals import saved_file from easy_thumbnails.signal_handlers import generate_aliases_global saved_file.connect(generate_aliases_global) This is working fine but is it possible to then access the url for those

addField type image and thumbnail path

北慕城南 提交于 2019-12-05 19:20:13
I have a Magento webshop and just created a custom module with the extension (Modulecreator). This module comes with a standard admin interface that can handle file uploads. I found out that if you want to show thumbnails you can use the 'image' field type (addField('myfield', 'image')) instead of the 'file' type field. But now i've got a problem. When I upload files, I save them in a subdirectory called 'slides' in the 'media' directory. But when I edit the item, the image path for the thumbnail next to the uploadfield is set to the 'media' folder. Not my folder as I set it to 'media/slides/'