Submitted by gouki on 2008, August 4, 7:21 PM
原文如下:附本人翻译(翻译水平其差,可以忽略直接看英文)
原文网址:http://valokuva.org/?p=92
- I know, it's been a while since I last blogged. This is because a lot of things are happening in my personal life. I recently relocated to London from Finland and started a new job. Things are quite busy but I will try to post an example now and then. In the meanwhile I would like to hear about sites using Imagick, so if your project is not super secret please post an url and maybe a small explanation what you're doing with Imagick on the site. This is purely for my personal interest.
-
- Anyway, to the point. Today's example originates from a question asked by a user. How do I thumbnail the image inside given dimensions proportionally and fill the "blank" areas with a color? Well, the answer is here :)
-
- The code is for Imagick 2.1.0 but adapting to older versions should not be hard.
翻译如下:
我知道现在离我的博客更新有一段时间了,这主要是因为最近发生了很多事。最近我找了份新工作,使我从芬兰搬到了伦敦,工作也非常忙,所以我在这里仅仅只发一个示例。同时我很高兴听到很多网站使用了imagick,我也希望如果您的项目不是很保密的话,是否能够发个链接及少量的注释以说明您的站点是如何使用Imagek的。顺便说一声,这完全是我个人的兴趣。
OK,上重头菜。今天的例子起源于一个用户的问题,那就是如果在为一张图片按比例做缩略图的时候,怎么为留空的地方用其他颜色填充。这个例子就是我的回复。
代码是FOR ImagicK 2.1.0版本,当然要改成以前的老版本代码也不是件难事。
下面就是代码了:
PHP代码
- <?php
-
- /* 定义缩略图的长宽*/
- $width = 100;
- $height = 100;
-
- /*创建一个对象,同时读回源图*/
- $im = new Imagick( "test.png" );
-
-
- /*按照比例进行缩放*/
- $im->thumbnailImage( $width, $height, true );
-
- $canvas = new Imagick();
- $canvas->newImage( $width, $height, 'pink', 'png' );
-
- $geometry = $im->getImageGeometry();
-
- $x = ( $width - $geometry['width'] ) / 2;
- $y = ( $height - $geometry['height'] ) / 2;
-
- $canvas->compositeImage( $im, imagick::COMPOSITE_OVER, $x, $y );
-
- header( "Content-Type: image/png" );
- echo $canvas;
- ?>
膘叔,上图片
源图:
缩图:
Tags: php, imagemagick, magicwand, thumbnail
PHP | 评论:1
| 阅读:24311
Submitted by gouki on 2008, August 4, 4:00 PM
啥也不说了。自己看列表吧。。原来,更新了这么多啊。。。。。。现在还是alpha,等到了stable,那我应该不应该更新呢》》》
更新列表(请看第44行哦)
- PHP NEWS
- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- ?? ??? 200?, PHP 5.3.0 Alpha 2
- - Removed shebang line check from CGI sapi (it is checked by scanner) (Dmitry)
-
- - Fixed bug #45696 (Not all DateTime methods allow method chaining). (Derick)
- - Fixed bug #45545 (DateInterval has a limitation of 4 chars for ISO
- durations). (Derick)
- - Fixed bug #45406 (session.serialize_handler declared by shared extension
- fails). (Kalle, oleg dot grenrus at dynamoid dot com)
- - Fixed bug #44100 (Inconsistent handling of static array declarations with
- duplicate keys). (Dmitry)
- - Fixed bug #43008 (php://filter uris ignore url encoded filternames and can't
- handle slashes). (Arnaud)
-
- 01 Aug 2008, PHP 5.3.0 Alpha 1
- - Upgraded bundled PCRE to version 7.7. (Nuno)
- - Upgraded bundled PDO sqlite to version 3.5.9. (Scott)
-
- - Moved extensions to PECL (Pierre):
- . ext/fdf
- . ext/ncurses
- . ext/sybase (not maintained anymore, sybase_ct has to be used instead)
-
- - Removed the experimental RPL (master/slave) functions from mysqli. (Andrey)
- - Removed zend.ze1_compatibility_mode. (Dmitry)
- - Deprecated ticks support. (Felipe)
-
- - Changed PCRE, Reflection and SPL extensions to be always enabled. (Marcus)
- - Changed md5() to use improved implementation. (Solar Designer, Dmitry)
- - Changed HTTP stream wrapper to accept any code between and including
- 200 to 399 as successful. (Mike, Noah Fontes)
-
- - Improved PHP syntax and semantics:
- . Added lambda functions and closures. (Christian Seiler, Dmitry)
- . Added "jump label" operator (limited "goto"). (Dmitry, Sara)
- . Added NOWDOC syntax. (Gwynne Raskind, Stas, Dmitry)
- . Added HEREDOC syntax with double quotes. (Lars Strojny, Felipe)
- . Added support for using static HEREDOCs to initialize static variables and
- class members or constants. (Matt)
- . Improved syntax highlighting and consistency for variables in double-quoted
- strings and literal text in HEREDOCs and backticks. (Matt)
- . Added "?:" operator. (Marcus)
- . Added support for namespaces. (Dmitry, Stas, Gregory)
- . Added support for Late Static Binding. (Dmitry, Etienne Kneuss)
- . Added support for __callStatic() magic method. (Sara)
- . Added forward_static_call(_array) to complete LSB. (Mike Lively)
- . Added support for dynamic access of static members using $foo::myFunc().
- (Etienne Kneuss)
- . Improved checks for callbacks. (Marcus)
- . Added __DIR__ constant. (Lars Strojny)
- . Added PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION,
- PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants.
- (Pierre)
- . Added new error modes E_USER_DEPRECATED and E_DEPRECATED.
- E_DEPRECATED is used to inform about stuff being scheduled for removal
- in future PHP versions. (Lars Strojny, Felipe, Marcus)
- . Added "request_order" INI variable to control specifically $_REQUEST
- behavior. (Stas)
- . Added support for exception linking. (Marcus)
- . Added ability to handle exceptions in destructors. (Marcus)
-
- - Improved PHP runtime speed and memory usage:
- . Substitute persistent constants by their values at compile time. (Matt)
- . Optimized ZEND_SIGNED_MULTIPLY_LONG(). (Matt)
- . Removed direct executor recursion. (Dmitry)
- . Use fastcall calling convention in executor on x86. (Dmitry)
- . Use IS_CV for direct access to $this variable. (Dmitry)
- . Use ZEND_FREE() opcode instead of ZEND_SWITCH_FREE(IS_TMP_VAR). (Dmitry)
- . Lazy EG(active_symbol_table) initialization. (Dmitry)
- . Optimized ZEND_RETURN opcode to not allocate and copy return value if it is
- not used. (Dmitry)
- . Replaced all flex based scanners with re2c based scanners.
- (Marcus, Nuno, Scott)
- . Added garbage collector. (David Wang, Dmitry).
- . Improved PHP binary size and startup speed with GCC4 visibility control.
- (Nuno)
- . Improved engine stack implementation for better performance and stability.
- (Dmitry)
- . Improved memory usage by moving constants to read only memory.
- (Dmitry, Pierre)
- . Changed exception handling. Now each op_array doesn't contain
- ZEND_HANDLE_EXCEPTION opcode in the end. (Dmitry)
- . Optimized require_once() and include_once() by eliminating fopen(3) on
- second usage. (Dmitry)
- . Optimized ZEND_FETCH_CLASS + ZEND_ADD_INTERFACE into single
- ZEND_ADD_INTERFACE opcode. (Dmitry)
- . Optimized string searching for a single character.
- (Michal Dziemianko, Scott)
- . Optimized interpolated strings to use one less opcode. (Matt)
-
- - Improved php.ini handling: (Jani)
- . Added ".htaccess" style user-defined php.ini files support for CGI/FastCGI.
- . Added support for special [PATH=/opt/httpd/www.example.com/] and
- [HOST=www.example.com] sections. Directives set in these sections can
- not be overridden by user-defined ini-files or during runtime.
- . Added better error reporting for php.ini syntax errors.
- . Allowed using full path to load modules using "extension" directive.
- . Allowed "ini-variables" to be used almost everywhere ini php.ini files.
- . Allowed using alphanumeric/variable indexes in "array" ini options.
- . Added 3rd optional parameter to parse_ini_file() to specify the scanning
- mode of INI_SCANNER_NORMAL or INI_SCANNER_RAW. In raw mode option values
- and section values are treated as-is.
- . Fixed get_cfg_var() to be able to return "array" ini options.
- . Added optional parameter to ini_get_all() to only retrieve the current
- value. (Hannes)
-
- - Improved and cleaned CGI code:
- . FastCGI is now always enabled and can not be disabled.
- See sapi/cgi/CHANGES for more details. (Dmitry)
- . Added CGI SAPI -T option which can be used to measure execution
- time of script repeated several times. (Dmitry)
-
- - Improved streams:
- . Fixed confusing error message on failure when no errors are logged. (Greg)
- . Added stream_supports_lock() function. (Benjamin Schulz)
- . Added "ignore_errors" option to http fopen wrapper. (David Zulke, Sara)
- . Added context parameter for copy() function. (Sara)
- . Added "glob://" stream wrapper. (Marcus)
- . Added "params" as optional parameter for stream_context_create(). (Sara)
- . Added ability to use stream wrappers in include_path. (Gregory, Dmitry)
-
- - Improved hash extension:
- . Changed mhash to be a wrapper layer around the hash extension. (Scott)
- . Added hash_copy() function. (Tony)
- . Added sha224 hash algorithm to the hash extension. (Scott)
-
- - Improved mbstring extension:
- . Added "mbstring.http_output_conv_mimetypes" INI directive that allows
- common non-text types such as "application/xhtml+xml" to be converted
- by mb_output_handler(). (Moriyoshi)
-
- - Improved OCI8 extension (Chris Jones/Oracle Corp.):
- . Added Database Resident Connection Pooling (DRCP) and Fast
- Application Notification (FAN) support.
- . Added support for Oracle External Authentication (not supported
- on Windows).
- . Improve persistent connection handling of restarted DBs.
- . Added SQLT_AFC (aka CHAR datatype) support to oci_bind_by_name.
- . Fixed bug #41069 (Seg fault with query over DB link).
- . Fixed define of SQLT_BDOUBLE and SQLT_BFLOAT constants with Oracle
- 10g ORACLE_HOME builds.
- . Changed default value of oci8.default_prefetch from 10 to 100.
- . Fixed PECL bug #12431 (OCI8 ping functionality is broken).
- . Allow building (e.g from PECL) the PHP 5.3-based OCI8 code with
- PHP 4.3.9 onwards.
-
- - Improved OpenSSL extension: (Dmitry)
- . Added support for OpenSSL digest and cipher functions.
- . Added access to internal values of DSA, RSA and DH keys.
-
- - Improved pcntl extension: (Arnaud)
- . Added pcntl_signal_dispatch().
- . Added pcntl_sigprocmask().
- . Added pcntl_sigwaitinfo().
- . Added pcntl_sigtimedwait().
-
- - Improved SOAP extension:
- . Added support for element names in context of XMLShema's <any>. (Dmitry)
- . Added ability to use Traversable objects instead of plain arrays.
- (Joshua Reese, Dmitry)
- . Fixed possible crash bug caused by an uninitialized value. (Zdash Urf)
-
- - Improved SPL extension:
- . Added SPL to list of standard extensions that cannot be disabled. (Marcus)
- . Added ability to store associative information with objects in
- SplObjectStorage. (Marcus)
- . Added ArrayAccess support to SplObjectStorage. (Marcus)
- . Added SplDoublyLinkedList, SplStack, SplQueue classes. (Etienne)
- . Added FilesystemIterator. (Marcus)
- . Added GlobIterator. (Marcus)
- . Added SplHeap, SplMinHeap, SplMaxHeap, SplPriorityQueue classes. (Etienne)
- . Added new parameter $prepend to spl_autoload_register(). (Etienne)
- . Added FixedArray. (Etienne, Tony)
- . Added delaying exceptions in SPL's autoload mechanism. (Marcus)
- . Added RecursiveTreeIterator. (Arnaud, Marcus)
- . Added MultipleIterator. (Arnaud, Marcus, Johannes)
-
- - Improved Zend Engine:
- . Added "compact" handler for Zend MM storage. (Dmitry)
- . Added "+" and "*" specifiers to zend_parse_parameters(). (Andrei)
- . Added concept of "delayed early binding" that allows opcode caches to
- perform class declaration (early and/or run-time binding) in exactly
- the same order as vanilla PHP. (Dmitry)
-
- - Improved crypt() function: (Pierre)
- . Added Blowfish and extended DES support. (Using Blowfish implementation
- from Solar Designer).
- . Made crypt features portable by providing our own implementations
- for crypt_r and the algorithms which are used when OS does not provide
- them. PHP implementations are always used for Windows builds.
-
- - Added new extensions:
- . Added fileinfo extension as replacement for mime_magic extension. (Derick)
- . Added intl extension for Internationalization. (Ed B., Vladimir I.,
- Dmitry L., Stanislav M., Vadim S., Kirti V.)
- . Added mysqlnd extension as replacement for libmysql for ext/mysql, mysqli
- and PDO_mysql. (Andrey, Johannes, Ulf)
- . Added phar extension for handling PHP Archives. (Greg, Marcus, Steph)
- . Added SQLite3 extension. (Scott)
-
- - Added new date/time functionality: (Derick)
- . date_parse_from_format(): Parse date/time strings according to a format.
- . date_create_from_format()/DateTime::createFromFormat(): Create a date/time
- object by parsing a date/time string according to a given format.
- . date_get_last_errors()/DateTime::getLastErrors(): Return a list of warnings
- and errors that were found while parsing a date/time string through:
- . strtotime() / new DateTime
- . date_create_from_format() / DateTime::createFromFormat()
- . date_parse_from_format().
- . support for abbreviation and offset based timezone specifiers for
- DateTime::getOffset() and DateTime::getName().
- . support for selectively listing timezone identifiers by continent or
- country code through timezone_identifiers_list() /
- DateTimezone::listIdentifiers().
- . timezone_location_get() / DateTimezone::getLocation() for retrieving
- location information from timezones.
- . date_timestamp_set() / DateTime::setTimestamp() to set a Unix timestamp
- without invoking the date parser. (Scott, Derick)
- . date_timestamp_get() / DateTime::getTimestamp() to retrieve the Unix
- timestamp belonging to a date object.
- . two optional parameters to timezone_transitions_get() /
- DateTimeZone::getTranstions() to limit the range of transitions being
- returned.
- . support for "first/last day of <month>" style texts.
- . support for date/time strings returned by MS SQL.
- . support for serialization and unserialization of DateTime objects.
- . support for diffing date/times through date_diff() / DateTime::diff().
- . support for adding/subtracting weekdays with strtotime() and
- DateTime::modify().
- . DateInterval class to represent the difference between two date/times.
- . support for parsing ISO intervals for use with DateInterval.
- . date_add() / DateTime::add(), date_sub() / DateTime::sub() for applying an
- interval to an existing date/time.
- . proper support for "this week", "previous week"/"last week" and "next week"
- phrases so that they actually mean the week and not a seven day period
- around the current day.
- . support for "<xth> <weekday of" and "last <weekday> of" phrases to be used
- with months - like in "last saturday of februari 2008".
- . DatePeriod class which supports iterating over a DateTime object applying
- DateInterval on each iteration, up to an end date or limited by maximum
- number of occurences.
-
- - Added array_replace() and array_replace_recursive() functions. (Matt)
- - Added ReflectionProperty::setAccessible() method that allows non-public
- property's values to be read through ::getValue(). (Derick)
- - Added msg_queue_exists() function to sysvmsg extension. (Benjamin Schulz)
- - Added Firebird specific attributes that can be set via PDO::setAttribute()
- to control formatting of date/timestamp columns: PDO::FB_ATTR_DATE_FORMAT,
- PDO::FB_ATTR_TIME_FORMAT and PDO::FB_ATTR_TIMESTAMP_FORMAT. (Lars W)
- - Added gmp_testbit() function. (Stas)
- - Added icon format support to getimagesize(). (Scott)
- - Added LDAP_OPT_NETWORK_TIMEOUT option for ldap_set_option() to allow
- setting network timeout (FR #42837). (Jani)
- - Added optional escape character parameter to fgetcsv(). (David Soria Parra)
- - Added an optional parameter to strstr() and stristr() for retrieval of either
- the part of haystack before or after first occurrence of needle.
- (Johannes, Felipe)
- - Added xsl->setProfiling() for profiling stylesheets. (Christian)
- - Added long-option feature to getopt() and made getopt() available also on
- win32 systems by adding a common getopt implementation into core.
- (David Soria Parra, Jani)
- - Added support for optional values, and = as separator, in getopt(). (Hannes)
- - Added lcfirst() function. (David C)
- - Added PREG_BAD_UTF8_OFFSET_ERROR constant. (Nuno)
- - Added native support for asinh(), acosh(), atanh(), log1p() and expm1().
- (Kalle)
- - Added inet_pton() and inet_ntop() also for Windows platforms. (Kalle)
- - Added mcrypt_create_iv() also for Windows platforms. (Pierre)
-
- - Fixed html_entity_decode() incorrectly converting numeric html entities
- to different characters with cp1251 and cp866. (Scott)
- - Fixed an issue in date() where a : was printed for the O modifier after a P
- modifier was used. (Derick)
- - Fixed exec() on Windows to not eat the first and last double quotes. (Scott)
-
- - Fixed PECL bug #12794 (PDOStatement->nextRowset() doesn�t work). (Johannes)
- - Fixed PECL bug #12401 (Add support for ATTR_FETCH_TABLE_NAMES). (Johannes)
-
- - Fixed bug #45622 (isset($arrayObject->p) misbehaves with ArrayObject::
- ARRAY_AS_PROPS set). (robin_fernandes at uk dot ibm dot com, Arnaud)
- - Fixed bug #45614 (ArrayIterator::current(), ::key() can show 1st private
- prop of wrapped object). (robin_fernandes at uk dot ibm dot com, Arnaud)
- - Fixed bug #45571 (ReflectionClass::export() shows superclasses' private
- static methods). (robin_fernandes at uk dot ibm dot com)
- - Fixed bug #45540 (stream_context_create creates bad http request). (Arnaud)
- - Fixed bug #45430 (windows implementation of crypt is not thread safe).
- (Pierre)
- - Fixed bug #45345 (SPLFileInfo::getPathInfo() returning dir info instead of
- file info). (Etienne)
- - Fixed bug #45179 (--with-mysql-sock fails to compile & work). (Andrey)
- - Fixed bug #45038 (Crash when using DateTimeZone object returned by
- Date::getTimezone). (Joe Orton, Derick)
- - Fixed bug #44769 (declaring private magic methods should throw error).
- (Felipe)
- - Fixed bug #44913 (Segfault when using return in combination with nested loops
- and continue 2). (Dmitry)
- - Fixed bug #44899 (__isset usage changes behavior of empty()). (Etienne)
- - Fixed bug #44897 (failed to prepare statement). (Andrey)
- - Fixed bug #44849 (imagecolorclosesthwb() is not available on Windows).
- (Kalle)
- - Fixed bug #44805 (rename() function is not portable to Windows). (Pierre)
- - Fixed bug #44779 (filter returns NULL in CLI when it shouldn't). (Arnaud)
- - Fixed bug #44742 (timezone_offset_get() causes segmentation faults). (Derick)
- - Fixed bug #44660 (Indexed and reference assignment to propery of non-object
- don't trigger warning). (Dmitry)
- - Fixed bug #44648 (Attribute names not checked for wellformedness). (Rob)
- - Fixed bug #44414 (Incomplete reporting about abstract methods). (Dmitry)
- - Fixed bug #44390 (mysqli_bind_param/bind_result and Object member variables).
- (Andrey)
- - Fixed bug #44352 (mysqli_connect_error() false negative for host errors).
- (Andrey)
- - Fixed bug #44336 (Improve pcre UTF-8 string matching performance).
- (frode at coretrek dot com, Nuno)
- - Fixed bug #44301 (Segfault when an exception is thrown on persistent
- connections). (Martin Jansen)
- - Fixed bug #44257 (timelib_tz_lookup_table must use float for gmtoffset).
- (Derick, iuri dot fiedoruk at hp dot com).
- - Fixed bug #44214 (Crash using preg_replace_callback() and global variable).
- (Nuno, Scott)
- - Fixed bug #44034 (FILE_IGNORE_NEW_LINES in file() does not work as expected
- when lines end in \r\n). (Ilia)
- - Fixed bug #43960 (strtotime() returns timestamp in the future when given a
- bogus string). (Derick)
- - Fixed bug #43832 (mysqli_get_charset() doesn't expose charset comment).
- (Andrey)
- - Fixed bug #43808 (date_create never fails (even when it should)). (Derick)
- - Fixed bug #43527 (DateTime created from a timestamp reports environment
- timezone). (Derick)
- - Fixed bug #43452 (strings containing a weekday, or a number plus weekday
- misbehaved if the current day-of-week was same as the one in the phrase).
- (Derick)
- - Fixed bug #43426 (crash on nested call_user_func() calls). (Dmitry)
- - Fixed bug #43323 (Wrong count abstract methods). (Felipe, Dmitry)
- - Fixed bug #43261 (Use ^ as the escape with escapeshellcmd() on Windows).
- (Scott)
- - Fixed bug #43075 (Support 2007-11-01T24:00:00+00:00). (Derick)
- - Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed
- using a timestamp). (Derick)
- - Fixed bug #43143 (Warning about empty IV with MCRYPT_MODE_ECB). (Derick)
- - Fixed bug #43136 (possible crash on script execution timeout.
- The EG(function_state_ptr) is completely removed,
- EG(current_execute_data)->function_state must be used instead). (Dmitry)
- - Fixed bug #42952 (soap cache file is created with insecure permissions).
- (Dmitry)
- - Fixed bug #42868 (Floats cast to integer produce unpredictable results).
- (Zoe Slattery)
- - Fixed bug #42848 (Status: header incorrect under FastCGI). (Dmitry)
- - Fixed bug #42773 (WSDL error causes HTTP 500 Response). (Dmitry)
- - Fixed bug #42737 (preg_split('//u') triggers a E_NOTICE with newlines).
- (Nuno)
- - Fixed bug #42736 (xmlrpc_server_call_method() crashes). (Tony)
- - Fixed bug #42663 (gzinflate() try to allocate all memory with truncated
- data). (Arnaud)
- - Fixed bug #42657 (ini_get() returns incorrect value when default is NULL).
- (Jani, Scott)
- - Fixed bug #42637 (SoapFault : Only http and https are allowed). (Bill Moran)
- - Fixed bug #42548 (mysqli PROCEDURE calls can't return result sets). (Hartmut)
- - Fixed bug #42509 (gmp leaks memory when gmp_init() not used). (Stas)
- - Fixed bug #42499 (PDO_MYSQL: multi-statement execution via PDO::exec() makes
- connection unusable). (Johannes)
- - Fixed bug #42443 (PDO SQLite driver binds integers and booleans as strings).
- (Scott)
- - Fixed bug #42284 (duplicate of #39700). (Lars W)
- - Fixed bug #42203 (Clear SQLite result sets before closing database). (Scott)
- - Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates
- DateTimeZone). (Derick)
- - Fixed bug #42069 (parse_ini_file() allows using some non-alpha numeric
- characters). (Jani)
- - Fixed bug #41997 (pdo_mysql: stored procedure call returning single rowset
- blocks future queries). (Johannes)
- - Fixed bug #41996 (Problem accessing Oracle ROWID). (Martin Jansen)
- - Fixed bug #41599 (setTime() fails after modify() is used). (Derick)
- - Fixed bug #41522 (PDO firebird driver returns null if it fails to connect).
- (Lars W)
- - Fixed bug #41135 (PDO SQLite driver binds blobs as strings,
- use sqlite3_bind_blob() to stop errors with null bytes). (Scott)
- - Fixed bug #39822 (new PDO() doesn't work with firebird). (Lars W)
- - Fixed bug #39700 (NUMERIC error when result precision are 7,8 or 12-14 ).
- (Lars W)
- - Fixed bug #39457 (Multiple invoked OO connections never close). (Andrey)
- - Fixed bug #39397 (invalid statement handle in Unknown on line 0). (Lars W)
- - Fixed bug #39346 (Unsetting a static variable inside a destructor causes
- segfault later on). (Dmitry)
- - Fixed bug #39127 (Old-style constructor fallbacks produce strange results).
- (Tony)
- - Fixed bug #39056 (Interbase NUMERIC data type error). (Lars W)
- - Fixed bug #39018 (Error control operator '@' fails to suppress "Uninitialized
- string offset"). (Felipe)
- - Fixed bug #38468 (Unexpected creation of cycle). (Dmitry)
- - Fixed bug #37964 (Reflection shows private methods of parent class).
- (Felipe, Marcus)
- - Fixed bug #37911 (preg_replace_callback() ignores named groups). (Nuno)
- - Fixed bug #37076 (SimpleXML ignores .=). (Felipe, Marcus)
- - Fixed bug #36128 (Interbase PDO - timestamp columns return NULL). (Lars W)
- - Fixed bug #35386 (firebird: first row is null). (Lars W)
- - Fixed bug #35163 (Array elements can lose references). (Dmitry)
- - Fixed bug #32330 (session_destroy, "Failed to initialize storage module",
- custom session handler). (Gwynne)
- - Fixed bug #32143 (ibase_query() causing IBserver 7 crash with NULL param as
- link-id). (Lars W)
- - Fixed bug #30907 (ibase_query() crashes (same bug as #32143). (Lars W)
- - Fixed bug #30690 (Resource handle from ibase_execute becomes invalid after
- return). (Lars W)
- - Fixed bug #29044 (compact() does not have infinite recursion protection).
- (Tony)
- - Fixed bug #27372 (parse error loading browscap.ini at apache startup).
- (Jani)
Tags: php, upgrade, namespace
PHP | 评论:1
| 阅读:26645
Submitted by gouki on 2008, August 3, 10:12 PM
本来也想不到谈这些,突然在群里看到石头发牢骚,并且发了链接,于是看了一下,感慨颇多,先贴上他写的东西。。。
不要用价格拼市场--倒闭时也要站着
- 很久没写BLGO了,发篇硬一点的文章,也许要挨骂了。
- 最近做项目,接触了很多企业和团队,感觉在技术市场,价格战已经打的相当的激烈了,一个企业站,简单的文章发布管理功能,一般的界面,价格已经低到1、2 千甚至几百了,这还是北京市场的价格。其实,技术根本不是这么不值钱的,即便没有什么技术含量,单也是相对于技术圈子里面而言,在任何市场里面,对于圈子内的人而言,都是没有什么技术含量的。
- 那最终为何导致,继家电价格战,打倒了一批家电企业后,这种事情又蔓延到软件行业呢,甚至我接触的一些传统行业,竟然也在暗流涌动。
- 我下面穿插着举几个例子,不一定是技术行业的,因为很多数字需要量化,软件项目不好讲清楚,用其他行业的,许是更能说明问题一些。
- 打价格战,其实初衷还是占领市场,可能制定价格战策略时,想的就是降一些价格,然后多拿一些单,利润不会下降,还能形成一定的客户群,即便不赚钱,持平,当把市场占领后,还是可以提价的。
- 这种说法对不对,我不会多说什么,我拿一组数字来说明一下问题吧:
- 我以一般的商品流通行业的利润率距离,通常,一个生产商可以赚到的毛利率在30%-35%,零售商赚到35%-40%,批发商赚到25%-35%,这样,我为了方便计算,把一个产品的毛利率,定为35%,应该是比较合理的。
- 在确定了一般的毛利率后,让我们计算一下,为什么不能降价,
- 比如我们卖100元的商品,会赚取35块钱,那么我们降价10块钱,但是我们的成本65块钱不会变动,也就是我们卖出一件商品,90元,只能获得25元利润,那么我们计算一下:
- 未降价:一件商品,65%的成本,35%的利润
- 降价后:一件商品,72%的成本,28%的利润
- 等于是我们降价10%后,成本上升了7%,也就是利润下降了7%
- 这个数值貌似很小,那么能说明什么呢?就意味着,我们要取得原来的利润,必须要多卖东西,这事所有人都能想象到的,那么我们在计算一下要多付出多少工作才能维持利润:
- X×28%=35
- X=125
- 也就是我们要卖出125块钱的产品,才能获得原来的利润,我们可以看到,我们的付出,可能要达到原来的140%才可以
- 当然,我这是粗略计算,也许事实上,你付出的还要更多,因为会牵扯到人员、物流、售后等成本,我只是用产品举例,其实,在软件外包中,这种降价导致的成本增长和工作量的加大,会更为明显,但是软件不好量化,我只能凭经验说,这种降价很恐怖。
-
- 我不指望能在一篇文章中,说明为什么不能打价格战,只是想引发个思考,也许我后面有时间,会写一些我如何避免价格战的经验,并且阐述一下,其实客户关注的,并不主要是价格,关注价格的客户,自然有其另一套应对的方式,而这么多年我接的项目,也没有一个通过价格战而获得的。
-
- 我再次说明我的观点,即便因为经营不善公司倒闭了,也不要因为价格战不能获利,而把自己累死,而不加入价格战,也未必不能很好存活下去,我希望有时间,我能把这些也写下来。
- 原文网址:http://blog.sina.com.cn/s/blog_507bdaba0100ad65.html
石头是搞过财务的,我是没有搞过,但我对这种情况也是很反感,05年我也就这方面探讨过(用探讨两个字是深了点,不如说是同样的发过牢骚吧)
当时的文章地址:http://www.cnitblog.com/neatstudio/archive/2005/07/07/804.html
http://www.cnitblog.com/neatstudio/archive/2005/07/09/841.html
两篇内容如下:
- 一直以来,在很多人心里,国产软件的性能比不上国外的同类软件,但是价格上却能低于国外同类软件,因此有部分人一直在鄙视着国内的软件从业人员。
- 可是,事实上呢?国内高性能的软件非常多,但是很多软件在发展到后面都遇上了瓶颈,结果就此停步,终止了软件的开发,造成软件在后续版本上由国外坐大。
- 国内编程人员的素质差!这句话是谁说的?确实有点道理,我指的是个人素质,而不是编程的素质。国内有一小部分程序员,到SF上下载一些OPENSOURCE的软件,稍作改头换面,就当成自己的软件,并进行销售,这类事件曾经电脑报上有报道过。
- 在这里,不得不提的是国内一些对程序员的看法以及所给的待遇。一些大公司都拿程序员当人看,而一些小公司则是把程序员当成挣钱的机器,每天工作时间超长,工资超低,这也就难保程序员在编程时偷懒而直接到网上找现成的代码来拼凑程序。
- 由于自己也经常接触到程序员,听听他们的诉苦得到的结论就是,程序员干的都不是人干的活呀。理由是现在程序员太多了,而且部分程序员的品德也比较差,辛苦接到一个单和人谈好价钱,结果被人横空插入,以绝对低价把单抢走,最后得到的消息是抢单的人拿网上现成的程序改改就交付了,客户在这种情况下又不满意,而抢单的人却消失了。这样的事情发生多了之后,就有了一个现象:程序不值钱,再便宜都有人做;程序员素质低,打一枪换一个地方;对程序员一定要能榨光剩余价值就榨光。
- 梁启超说过:长此以往,国将不国。在这里我只是想说,长此以往,程序员将消失掉。试想,很多人抱着开源的思想在网上公布代码后,后果却是:1、人身攻击,言辞大多是:垃圾程序也好意思拿出来公布这;2、恶意抵毁,这种情况往往是公布的程序与某商业程序产生了冲突,影响了销售。其他情况也不好意思说了,我自己就曾遇到这一点。
- 国产软件究竟该如何走?
- 在经历了种种挫折后,很多软件作者开始把目光投向海外。事实证明,这样的策略是正确的,一来国外对版权比较重视,二来国外的客户把程序员当人看(其实也可 能是国外的消费水平和国内不同罢了)。很多共享软件因此而获得了较高的收益。这种情况造成国内的客户看不到高手,高手也不愿意再兼顾国内。很多人就开始认 为,国内没有编程高手,现有的程序员都是一些水平比较低的人,给他们的项目价钱不能太高,如此循环往复,造成了恶性循环。
- 目前,我们这些程序员要做的事情就是:以国外软件开发为主,同时为国内的市场提供一些比较有针对性的软件。不要让国内的客户对程序员失望,同时要清理开发市场,对那些开发水平不高,还要乱报价的程序员应该进行强烈批评并查实后进行通报。
- 在这种情况下,程序员的地位可能会得到一定的提高。然而,程序员实在太多了,要好好的洗牌毕竟只是一个构想。
- 希望各位有识之士能够认同,并为提高程序员的修养尽一份力。
牢骚也发过了。可惜市场并不因为我们的牢骚而改变。现在,只能多发发牢骚了
Tags: 竞争, 软件, 开发, 价格, 市场
Misc | 评论:0
| 阅读:21021
Submitted by gouki on 2008, August 3, 1:54 PM
一直让我最郁闷的就是自己的英文水平了,看吧,能看得懂一点点,听吧,一点点也听不懂,连哑巴英语也算不上。
看到新东方上有林语堂老先生的心得,不禁摘录下来,也可以多学习一些前辈的先进经验吧。
林语堂先生(1895-1976),现代文学家、翻译家和英语大师。他一生共出版中文集3种,英文著作36种。他从中国人学习英语的实际出发,提出了一系列的英语教学方法和英语学习方法,至今仍然值得我们借鉴。
一、学英文时须学全句,勿专念单字。学时须把全句语法、语音及腔调整个读出来。
二、学时不可以识字为足。识之必然兼用之。凡遇新字,必至少学得该字之一种正确用法。以后见有多种用法,便多记住。
三、识字不可强记。得其句中用法,自然容易记得。
四、读英文时须耳目口手并到。耳闻、目见、口讲、手抄,缺一不可。四者备,字句自然记得。
五、“四到”中以口到为主要。英语便是英国话,如果不肯开口,如何学得说话?
六、口讲必须重叠练习,凡习一字一句必须反复习诵十数次至数十次,到口音纯熟为止。学外国语与学古文同一道理,须以背诵为入门捷径。每谋取一二句背诵之。日久必有大进。
七、口讲练习有二忌。
(一)忌怕羞。学者在课堂上怕羞,则他处更无练习机会。
(二)忌想分数。一想到分数,便怕说错,怕说错,便开口不得。最后的胜利者,还是不怕羞、不怕错、充分练习的学生。若得教员随时指正,自然可由多错而少错,由少错而纯正,由纯正而流利,甚至由流利而精通。此是先苦后甘之法。
八、读节要精。读音拼写,皆须注意。马马虎虎,糊涂了事,不但英文学不好,任何学问也学不好。
原文:http://www.neworiental.org/Default.aspx?TabID=1130&InfoID=241419&SettingModuleID=2483
Tags: 英语学习, 林语堂, 技巧
Literature | 评论:0
| 阅读:27273
Submitted by gouki on 2008, August 2, 8:36 PM
今天看到一个好东西,是jquery的API,这次的API不是象以前那样用XML的,也不是那种根据官方的数据简单的汉化而来的,这次。。。。阿健同学编译成了CHM文件(虽然以前的也是CHM文件),并且有索引和搜索功能哦。只是由于编译方式的问题吧?不支持中文搜索,不过也总比以前那种纯粹的一个页面来的爽。OH YEAH。。。
剩下一个嘛,就是传统的CSS手册了,这个手册估计只要是WEB开发人员就会人手一份,苏沈小雨同学实在是太让人尊敬了,估计国内开发人员提到CSS手册,都会说,哦,就是那个苏沈小雨的呀。。。
不多说,放上链接。黑黑
注意:jqueryApi文件打开后会生成一个chw的文件,如果你看不顺眼可以每次删掉
附件: jqueryapi_chm.chm (210.1 K, 下载次数:6215)
附件: cascading style sheet 2.0 中文手册.chm (258.56 K, 下载次数:3605)
Tags: chm, css, style, jquery, api
Software | 评论:0
| 阅读:23257