Author Archive

Mencoder和ffmpeg使用实例

下载电影的时候,我们总希望在全部下载完成之前能够预览一下影片内容,于是发布者时常会放一些影片截图在种子文件中,或者直接贴到网上,也有一些截图是一张图片,但包含很多幅影片在一起,就像下面这张: imagemagick-montage-sample

有很多软件能够截取影片图像、合并图像,但如果影片太多,比如视频网站为用户上传的图像生成预览图之类的,人工在gui方式下操作就不可取了,我们需要在命令行方式下来截取、合并。 (continue reading…)


ffmpeg视频截图

php也可以使用ffmpeg-php扩展ffmpeg。但是我个人觉的这个效率可能不太高。
还是决定用shell 去执行,或放在服务器端的让任务去执行。 (continue reading…)


typo3强制生成缓存图

$gifCreator = t3lib_div::makeInstance(‘tslib_gifbuilder’);

$gifCreator->init();

$imgarray =  $gifCreator->imageMagickConvert(‘photo_350_210.jpg’, ‘web’, ”, ”, ‘-colorspace RGB -quality 90’, ”, array(‘maxW’=>1000,’maxH’=>900),1);

echo ‘<img src=”‘.$imgarray[3].'”/>’;

 

typo3temp/pics/9577836ec0.jpg


substituteOldMailAPI

Boolean: If this is set, old calls to t3lib_utility_mail::Mail() will be translated to new t3lib_mail calls. This should work on most cases and thus respect the above transport settings. If you get garbled emails (or no attachments), consider setting this off. Ask the extension author to upgrade their code to make use of t3lib_mail (instead of the deprecated t3lib_htmlmail).


PHP – $argv

$argv — 传递给脚本的参数数组

说明

包含当运行于命令行下时传递给当前脚本的参数的数组。

Note: 第一个参数总是当前脚本的文件名,因此 $argv[0] 就是脚本文件名。

Note: 这个变量仅在 register_argc_argv 打开时可用。 (continue reading…)



sql语法:inner join on, left join on, right join on详细使用方法

inner join(等值连接) 只返回两个表中联结字段相等的行
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录

right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录 (continue reading…)


syslog

[belogErrorReporting]

  1. Integer: Configures which PHP errors should be logged to the “syslog” table (extension: belog). If set to “0” no PHP errors are logged to the sys_log table. Default is “E_ALL ^ E_NOTICE” (6135).

 


how to get a js png fix to work on ajax calls

If you are using iepngfix.htc, you might try setting the behavior inline

var myEl = document.getElementById('inbound-ajax-element');
myEl.style.behavior = 'url(iepngfix.htc)';

http://www.twinhelix.com/css/iepngfix/demo/

 

You should take a look here jQuery IE PNG Fix Plugin

jQuery(function($) {
    $("img[@src$=png], #image-one, #image-two").pngfix();
});

You should run this on the images you just loaded.

 

demo:

 

function filterAlphaImages(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	if (itsAllGood) {
		for (var i=0; i<document.all.length; i++){
			var obj = document.all[i];
			var bg = obj.currentStyle.backgroundImage;
			var img = document.images[i];
			if (bg && bg.match(/\.png/i) != null) {
			var img = bg.substring(5,bg.length-2);
			var offset = obj.style["background-position"];
			obj.style.filter =
			"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
			obj.style.backgroundImage = "url('fileadmin/templates/images/pixel.gif')";
			obj.style["background-position"] = offset; // reapply
			} else if (img && img.src.match(/\.png$/i) != null) {
			var src = img.src;
			img.style.width = img.width + "px";
			img.style.height = img.height + "px";
			img.style.filter =
			"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"
			img.src = "fileadmin/templates/images/pixel.gif";
			}
		}
	}
}

 


typoscript numberFormat

Calls the PHP function number_format
Allows you to format numbers
Note: TYPO3 v4.5 introduces a stdWrap property numberFormat. In order to avoid conflicts, the extension disables its own stdWrap property described below.Converting a number to localized Euro value

(continue reading…)


Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress