-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
There maybe something interesting in it for the PHP-Pros around here: 26 Ways to Show that PHP Can Be Better Than PHP Features that PHP does not have yet: 1. Aspect Oriented Programming 2. Annotations 3. Extended class meta-data beyond reflection 4. Prototype variables like in JavaScript 5. Dynamically extend class with plugins 6. Friend or package access classes 7. Class generics (templates) 8. Turn errors into exceptions 9. Introspection of private functions and variables 10. Alternative auto-loading of classes 11. Running multiple scripts in parallel 12. Named parameters 13. Running unaudited PHP code in a sandbox 14. Class composition 15. Deferred execution of long tasks 16. Satisfy needless dependencies with dummy interfaces 17. Comparable interface 18. Iterable interface Features that PHP already has: 19. Executing code automatically when exiting a function 20. Class destructors 21. Namespaces 22. Overloading 23. Closures 24. Function parameter type checking 25. Mixing the functionality of different classes 26. Serializing objects that reference each other
-
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
I have added the sharpening and quality-select to Thumbnails-Module -
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
@Ryan: will you add getters to the class? Have downloaded last dev-branch, but haven't seen it. Meanwhile I've done some Sharpening Tests with GD: Looks very promising! -
Hi, just a pw-beginners-question: is it possible to convert an existing site (eg 'Basic Example Site') to a Multilanguage site? I have tried an installed core language modules, have setup languages and everything works fine. But when trying to change Fields to LanguageFields in Templates I get an error and afterwards DB is damaged: Error: Exception: Unknown column 'field_title.data1022' in 'field list'
-
Hi Totoff, HeidiSQL for Windows is a nice tool which can do manually Backups from Databases. Not only dump into files, also transfer from one DB to an other, and some more. But DB's must be accessible from outside, not only from localhost.
-
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
Hi Ryan, only need read-access to: $filename $extension $imageType $image $modified -
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
:D -
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
ok, - fine. My skills with PHP5 are not that great. Don't know really what I've thought when viewing ImageSizer-Class?! Maybe something like: when hooking into it I can use it like the original I use PHP4 for about 10 years with CLI-scripts, but PHP5 is new to me. So, have set it from protected to public and now I can read them. Thanks! -
Oh, Joss - sorry, I have not read it first. Xenu is a crawler which checks for broken links. I think there is no need for maps. Just let Xenu start at your root and wait until it emails you the result.
-
If you want to use Pro Cache Module for that and want to play save - I recommend a run with Xenu's Link Sleuth Also, like Teppo mentioned, HTTrack is a good solution for creating offline-version of sites
-
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
Hi, - yes it should! But it doesn't! I went a bit mad about that. So, as I have no idea of what is special with PW or how it works, it maybe not very helpful when I try to debug it, but I have done it. Hopefully you (or Ryan!!) may understand a bit of what I try to tell: when try to assign: $this->img = $event->object; (I step into here with debugger and list next steps with data now): WireData __get($key) $key is 'object' of type string WireData get($key) " after that $this->img holds reference to ImageSizer == correct now try to assign: $filename = $this->img->filename; : Wire __get($name) $name is filename of type string ... if($this->useFuel($useFuel) is null ?? is this right here ?? however: it returns TRUE next step is: Fuel __get($key) $key is "filename" of type string and the function trys to return $this->data[$key] or NULL whereas $this->data is array with 20 keys like: config, wire, notices, sanitizer, db, modules, fieldtypes, etc etc but no 'filename' so, finally i get NULL returned This seems not to be correct at this point. attached is a screenshot of Call-Stack -
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
it is class 'ImageSizer'! -
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
Hi, have started to create the module, but don't get it right. To start, I use: $this->addHookBefore('ImageSizer::resize', $this, 'read_metadata'); $this->addHookAfter('ImageSizer::resize', $this, 'write_metadata'); With first tests I upload images, the hooks get called. With read_metadata I want to check if the current image is a jpeg. I try to read from $event->object->imageType like this: public function read_metadata( HookEvent $event ) { $this->img = $event->object; $this->isOurJob = $this->img->imageType == IMAGETYPE_JPEG ? true : false; if( ! $this->isOurJob ) { return; } $filename = $event->object->filename; // test to assign string to my var // ... $this->logActivity('have read metadata from ' . $this->img->filename ); } I have also tried others like $event->data['object']->imageType etc. but I'm always get empty results. Same behave with $event->object->filename: in my Editor I can see that there is the filename but it did not get assigned to my vars. So, what I'm missing? -
I have only used a phpclass that rely on the php-zip-extension. This work on Linux and Windows. With this it is very simple and robust usage: $unzip = new unzip2($ZIPFILE); $unzip->debug = 1; // 0 = off $list = $unzip->getList(); foreach($list as $fileName=>$zippedFile) { if( ! in_array($zippedFile['type'], array('jpg','png','gif') ) { continue; } $res = $unzip->unzip($fileName, $dest_path); } Pete uses the php-zip-function with his Module ScheduleBackups. I have tested it on windows and the created archives provided much information of compressed files, more than some other solutions.
-
Hi, ok,- you want to install a language pack what is a zip-archive. I'm new to PW and don't get touched with language-packs til now, but have read before a minute the Instructions: So, I cannot see really a problem with it!
-
Hi, when you are on your own local machine and want to 'upload' a file and wants to get it unzipped, you should provide the path to an unzip-app and all needed params / flags for it. (A commandline app!) If you don't have one, you may go and fetch 7z. It comes with an additional commandline prog called '7za.exe' Put it somewhere into your systempath, open a shell command (cmd.exe) and type in 7za -h or 7za --help to get a list of available commands and switches. If you have figured out the needed command and switch/es, write this into your PW-site config.php, instead of the unix there. I use 7za.exe sometimes with PHP-CLI on my local machine, - but only to zip archives. I never have used it to unzip via cli.
-
http://www.swisscinema.org/gimage/b9b371458ab7c314f88b81c553f6ce51.jpg
-
Hi, have done the first tests with templates and want to share this one as a starting point for a lightwight responsive layout. Could be good for small websites without the need of big frameworks. The zip contains head.inc and foot.inc like they are in ProcessWires Basic-Example-Profile, and 2 css and 2 js files. If you want try out just Backup the head.inc and foot.inc from Basic-Example-Profile and copy the files form zip file into templates folder.
- 1 reply
-
- 8
-
Looks good. Want to download, - but the links are dead
-
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
In short: every serious photographer tags his work in his workflow but at least the public files. For this, before 2004, there was only the IPTC-Standard. In 2004 Adobe starts to take this over in its own featured XMP-format. IPTC is now integrated in XMP as IPTC-core and IPTC-extended whereas the older IPTC-Marker can/will be used in parallel, - what has confused a lot of workflow setups. In PHP-world the common workaround was / is to strip out every metadata (XMP, EXIF, IPTC) and only writeback into the older IPTC-Marker. This way all further readers, incl. Adobe's, get same infos. This is right. As I've pointed to above, most of these standards are not of interest in serious image business. for me all Exifdata (without the copyright notice) is rubbish You have already pointed to the PHP-JPEG-Metadata-Toolkit what I would use for a 'big solution' whereas a small solution only needs internal PHP-functions. Combined solution could be: reading with Metadata Toolkit and writeback most important (merged) data only to IPTC-Marker. (reduces filesize, especially with small output length) -
Proper image type checking (instead of extensions) for ImageSizer
horst replied to teppo's topic in Wishlist & Roadmap
Hi, there is a post here describing some strange behave. I don't really know whats going on there and if the ImageSizer is invoked in this, but when looking into ImageSizer->resize (Line 284 and following) there is not really checked the result of write-to-file functions. Maybe it would be better to do something like: $result = imagejpeg($thumb2, $dest, $this->quality); ... if($result===false) return false; or at least do a check at the end and return the result of $this->loadImageInfo() instead of always return true. -
Hi, - sorry, I might not of great help in this, but it maybe that this behave not only target the module but also the ImageSize-core: you should post or reference in this Topic too: http://processwire.com/talk/topic/1448-proper-image-type-checking-instead-of-extensions-for-imagesizer/ The new site on the same server is pw 2.2.15 too?
-
don't want create images with GD-lib, - and some more needs
horst replied to horst's topic in General Support
Short info about progress: I've setup a test with nearly 30 very different images: downsized from original dimensions to 1200, 700, 300 px in one step and for following qualities: 100, 96, 93, 90, 85, 80 there are no differences in filesize or they are less than 1% to my surprise the quality of GD2 is much better than I have had in mind (maybe I've remembered the GD1 ??, - to my apologize: I've done all image processing locally with Photoshop for the last - ?? - oh god, it seems to be true: for the last 6-7 years) In very dark parts of images both libs show good differences with details, also details of highkey parts are nearly equal with both image processors. Only the sharpness of Netpbm is a little bit better than with GD. But it's that little that it is hard to see when placing to images besides. (when switching in an imageviewer one can see it). (a table comparing imagesizes is here) --- intermediate conclusion: I will focus on GD2 and do some tests with sharpening and multi-step-sizing, also high prior is on Metadata reading and writing on schedule with less prior maybe Watermarking with alpha-transparency-png. I think, best way to writeback metadata is to build a module that hooks in before image-size process starts and once again after image-sizer has finished: public function init() { $this->addHook('WHAT IS THE RIGHT HOOK FOR THIS?', $this, 'readMetadata'); $this->addHookAfter('AND FOR THIS?', $this, 'writeMetadata'); } Is this the right way? And if yes, how are the names for the HOOKs? Any advice is welcome.