Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. but my answer is (meant) in regard of "ease of use" ! lesser fields to type in or to select from centralized overview compared to no overview! etc.
  2. I think this is related to your other Topic here: https://processwire.com/talk/topic/8300-image-color-palette-generator/ Please do not open different Topics.
  3. @Pete: regarding your "test.jpg", you only need to build a name that matches the new naming conventions of PW core Pageimage. That way all is fine because PW will do the dishes for you. It takes care of all image variations belonging to an original image. You only need to tell the system that this is a derivative image. The naming scheme now is aware of suffixes. You simply can use the original filename and add a suffix to it. (in fact it isn't limited to only one suffix, it can have multiple of them). Following the original image is named basename.ext If you want create one or more derivatives you should go with this scheme: basename.-suffix.ext basename.-suffix1-suffix2.ext following i change your above example in a detailed manner: // define suffix, and fileformat if needed $suffix = 'yoursuffix'; // allowed are: a-z 0-9 and underscore !! not more! $ext = 'png'; // your desired outputformat $image = $page->images->first(); // get the image $info = pathinfo($image->filename); $dir = $info['dirname']; // dir to the page assets/files/ folder $name = $info['filename']; // basename without extension $ext = $info['extension']; // only if you want use the same fileformat as the original is !! // build the targetfilename and the URL $targetFilename = $dir .'/'. $name .'-'. $suffix .'.'. $ext; $targetURL = dirname($image->url) .'/'. $name .'-'. $suffix .'.'. $ext; $sourceFilename = $dir .'/'. basename($image->getThumb('thumbname')); // Now do your nice manipulations if the image doesn't already exist (we only want to convert it once) if (!file_exists($targetFilename)) { $modules->get('PageImageManipulator')->imLoad($sourceFilename)->setOutputFormat($ext)->setTargetFilename($targetFilename)->save(); // or this way $modules->get('PageImageManipulator')->imLoad($sourceFilename)->setOptions(array('outputFormat'=>$ext, 'targetFilename'=>$targetFilename))->save(); } echo "<img src='{$targetURL}' />"; . . Additionally, if you use Pia to assist you while developing a site, your code should ask her if you are actually online and like to refresh all images: // Now do your nice manipulations if the image doesn't already exist or if you (Pete) are actually online, testing something and want force recreate images if (!file_exists($targetFilename) || true === $config->imageSizerOptions['forceNew']) { ... I love it when a plan comes together!
  4. @tinacious: what do you get when you try: setlocale(LC_ALL, ($is_english ? 'en_US' : 'fr_FR.UTF-8'));
  5. beer wine whisky coffee-mug food film/video camera
  6. with PW version 2.5+ it can be done now: https://processwire.com/talk/topic/8386-image-animated-gif/
  7. @Pete: I'm not sure if I have updated the Pim after that post here: https://processwire.com/talk/topic/4264-release-page-image-manipulator/page-5#entry60648 possibly not. So best you do not pass your options with the class-init but with the ->setOptions($options) method or with individual methods ->setTargetfilename ->setOutputformat, Can you test it and report back please?
  8. Image Animated GIF v 2.0.2 Module for PW 2.5 stable or newer, but is obsolete for PW Versions greater then 3.0.89 (... read more ...) This module helps with resizing and cropping of animated GIFs when using the GD-Library. The GD-Library does not support this. This module is completely based upon the fantastic work of László Zsidi (http://www.gifs.hu/, builts the initial classes) xurei (https://github.com/xurei/GIFDecoder_optimized, enhanced the classes) I have ported it to a PW module and it works with core imagefields, together with Pia and with CropImagefields that uses the new naming scheme since PW 2.5. ------------------------------------------------------------------------------------------------------------------------------------------ read more in this post about the rewrite from version 1.0.0 to version 2.0.0 ------------------------------------------------------------------------------------------------------------------------------------------ You can find it in the modules directory: https://modules.processwire.com/modules/image-animated-gif/ and on Github: https://github.com/horst-n/ImageAnimatedGif ------ A preview can be found here
  9. Updated to version 4 - I had to fix the forceNew option what may be used during site develope. - also have changed a bit on the GUI: it detects if you have Fieldtype RangeSlider installed and uses that over a regular Integer Inputfield for Quality-Setting If you are already using it, please update too.
  10. @rajo: I cannot really follow the logic. To me it looks simply wrong and the opposite is true: a) actually we have that every parent page need: 1 entry for a special parent template name at templates setup (add one entry per different parent type) 1 entry for a special child template name at templates setup 1 entry for storing the parent template name on the page b) the way you want to change it would result in: 1 entry for a basic parent template name at templates setup (is used by multiple parents) 1 entry for a special child template name at templates setup 1 entry for storing the parent template name on the page +1 for storing a children template name on the page (what is very different compared to only one relation in family settings in the templates setup, or I'm wrong here?) Conclusion: Both solutions may use equal amount of DB entries to specify family relations, whereas b) seem to add some more as it delegates a setting from centralized templates setup (where it is defined only one time) onto the pages layer, what multiply these entries. So, a) needs more entries for template parent names, whereas b) only needs one parent template name here. - So lets say it is equal! with a) you have a centralized and informational overview on the templates setup page, whereas with b) some informations are hidden from there and also from everywhere. You will lost the overview of your family relation settings! thats all tolerable, may be, but not: Additionaly, if you want to create a new module for something what you allready can do, you put another layer of overhead to it the process. The module needs to hook into something and check and decide and may pass back or take it into its department, etc etc etc. !! So a) seems to be a good solution and b) seems at least to triple the noise here. Or have I got something wrong with this?
  11. <kidding>better not "the main concept" but "one of the main concepts"</kidding>
  12. thanks for the nice words. 1) unfortunately Pia only assist with preparing and delegating values to the images engines. She isn't able to process images by herself. What you are requesting is "canvas", it is provided by Pim. I don't know yet if Pia dynamically should support shortcuts depending on other installed modules or not. It can become a bit confusing. On the other hand I see how comfortable it could be if Pia would assist here too. 2) I will do so when finding a bit time for it. yes, she is!
  13. Glad it is working now for you! Your hosting company uses LiteSpeed and now PHP 5.5. It must have been a specific configuration problem there, because PW 2.5 is running fine on PHP 5.4. Any chance we can get to know what problem it was they have solved with changing the PHP version?
  14. Hi Marty, assuming you want to build a grid upon an unknown collection of images and you want to have full control, you may start with this construct and change it to suite your needs: echo "<br /><hr /><pre style='font-family:monospace;'>"; // only a little test unit $yourImagesArray = array( 1,1,1,1,1,1, 1,2,1,1,1, 1,1,1,1,1,2, 1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1,1,1,1,2,1,1,1,2,1,1,1,2,1,2,1,1,1,2,1); // build the grid $images = $yourImagesArray; // containing lots of images, most with no tag or a "single" tag and some with a "twice" tag! You have to make sure it contains enough images for your grid, so. $i = 0; for ($row=1; $row<=7; $row++) { echo "\n$row:"; // only for the test for ($col=1; $col<=6; $col++) { // get the next image from the collection $img = $images[$i++]; // you would use $images->eq(++$i) with real images here! if (6 == $col) { // only special case is with the last $col while (2 == $img) { // last $col cannot take a "twice"-image. For the example I simply drop all "twices" while searching for a single-one. $img = $images[$i++]; } } // now we have a valid $img for our grid, so create output if (2 == $img) { $col++; // adjust the $col counter! echo 'oo'; } else { echo 'O'; } } } // ready with grid echo "</pre><br /><hr />"; // only for the little test unit test output is: 1:OOOOOO 2:OooOOO 3:OOOOOO 4:OOooOO 5:OooOoo 6:OOOooO 7:OOOooO
  15. Nice one! Looks good - very good on FF33 Win7 Looks ok - good on IE11 Win7 (seems to be a bit slower than FF or is less smooth than FF) ------- Related to the Article: Which browsers should be supported by this? IE9+ ------- It remembers me on a site Fokke has created and posted to the showcase There are no overlays, only the movement and fading with the background images. There it is done a bit different, it seems to use different move directions (N, E, S, W) and also has a return point. Feels a bit more like "Ken Burns Effect". Would this be possible with your module too, defining direction per slide?
  16. Hi @Sephiroth, welcome to the forums. I have read your questions but am not able to give useful answers. I'm more comfortable with the images. But I'm sure you will get useful answers here.
  17. Pia - Pageimage Assistant Hello, today I can tell you that Pia Ballerina want to assist you with Pageimages and that can become really helpful! . . . Pia, in its current state, version 1.0.0, provides: a GUI (the module config screen) for quick and easy changes to the sitewide Pageimage default options an alternative way for calling the Pageimage resizing methods with PW selector strings three new methods as shortcuts to the resizing functions a new method called retinafy and its alias hiDPI, (introduced in version 0.2.0) . . . 2) Instead of ->width(), ->height(), ->size() you can call ->pia() now. With a PW selector string you tell Pia what image variation you want to have : . $image->pia("width=100, quality=80, sharpening=medium")->url; . If you want process ->width() just define width. If you want process ->height() only define height. If you want process ->size() just define width and height. If you want process ->size() with equal values for width and height, just define only size, or use the alias square: . $image->pia("width=480")->url; $image->pia("height=320")->url; $image->pia("width=400, height=300")->url; $image->pia("size=350")->url; $image->pia("square=350")->url; . So, yes, - I see. Now you may think: "Ok, nice looking girl, - and she can dance very well, - but for what should it be good that she is involved here? My very old buddies width, height and size - and me, - we don't need any Ballerinas between us!" . Yeah, I see what you mean. But this above is not what Pia is good for, this is just a little warming up for you. . In some cases one need to specify more than just width and / or height. If it comes to that you need explicitly populated options with the individual pageimages, Pia will become faster and more comfortable at some point. Also the code is looking more readable with Pia, at least to me: . // regular style #1: $image->width(800, array("upscaling" => false, "cropping" => true, "quality" => 80, "sharpening" => "strong")); // or regular style #2: $options = array("upscaling" => false, "cropping" => true, "quality" => 80, "sharpening" => "strong"); $image->width(800, $options); // now lets Pia dance: $image->pia('width=800, upscaling=0, cropping=1, quality=80, sharpening=strong'); $image->pia('width=800, upscaling=off, cropping=on, quality=80, sharpening=strong'); . For me it is that not only Pia begin to dance, my fingers do so too when writing selector strings instead of the regular array code. . Ok, last thing before we can go to stage: "You already may have noticed that Pia accepts few different values for boolean expression, yes?" for TRUE you can write these strings: "1, on, ON, true, TRUE, -1" for FALSE you may use one out of "0, off, OFF, false, FALSE" Ready? Ok, lets go to stage. . . . 3) Pia provide three new methods as shortcuts. This means that when using one of the shortcuts you have pre-populated options, regardless of the sitewide default settings: crop :: does what the name says contain :: is equal to the regular method: ->size($width, $height, array("cropping" => false)) cover :: this, Pias third child, is a new kid on the block . Let's have a closer look and compare it. We use Pias image from above as source for this example. (It's dimensions are 289 x 400 px) . . * crop $image->crop('square=100'); . it is 100 x 100 px and the name is: pia-ballerina_titel.100x100-piacrop.jpg . . . * contain $image->contain('square=100'); . it is 73 x 100 px and the name is: pia-ballerina_titel.100x100-piacontain.jpg . . . * cover $image->cover('square=100'); . it is 100 x 139 px and the name is: pia-ballerina_titel.100x139-piacover.jpg . . . Ok, you got it? . "Crop" crop out the area, "Contain" fits the image into the area, and "Cover" calculates the needed dimensions for the image so that the area is completly covered by it. . Following is a link with lots of those crop-, contain-, cover- variations. I have stress-tested it a bit: much variations . ---------- . . Later Additions: . * contain with option weighten Since version 0.0.6 contain can take an additional param called "weighten". (read more here) . . . * retinafy Since version 0.2.0 retinafy is added. It returns a markup string, e.g. a HTML img tag, where placeholders are populated with property values from the pageimage. Default properties are: URL, WIDTH, HEIGHT, DESCRIPTION. The method also can take an optional array with CustomPropertyNames. You also can use the alias HiDPI if you like. (read more here) . . ---------- . . You can get the module from the modules directory or from the repo on Github: . git clone https://github.com/horst-n/PageimageAssistant.git your/path/site/modules/PageimageAssistant . . Bye! . Classical ballet performance at the Aalto Theatre in Essen, in the context of the Red Dot Award ceremony 26 June 2007, Act III, Sleeping Beauty, the wedding reception Photos: Horst Nogajski - www.nogajski.de
  18. Do you have updated PW version to 2.5.9 ?? Also switch back to default Admin Theme! just as a test!
  19. OMG. Animated gifs! I suddenly feel so retro. But seriously, PW with GD-lib doesn't support this. And as your request now seems to be the first that arrives here, it shows that this is a really rare case today. Teppo already has done a good recherche on that and it shows that this is not a small piece of work. I don't think that Ryan would want a full support for that to go into the core. (If not more than 20% or 30%? of the users need this it has to go into a module). But you need a quick solution now. You may check if your host supports IMAGICK, (not 'ImageMagick', but 'ImageMagick' through a PHP-Extension called 'Imagick'). If yes, install and try out ImagickResizer. I don't know if it supports animated GIFs yet, but there is a good chance it does. If this doesn't work for you, can you display them just with "resizing" by css dimensions? (Is this the only case where you need this) If above both doesn't work, I think the only thing what can be done quickly is to implement a check for animated GIFs into the Imagesizer (or maybe as a workaround, into your template code) and if it is a animated one, redirect the manipulation to one of the mentioned LIBs at StackOverflow.
  20. Hey, I see what you mean, but unfortunately that's not my job site. Maybe it is possible to manipulate those js and/or related css files and store them under site/modules/InputfieldCKEditor/. But I don't really know, - that's not my job site.
  21. If it is related to that what was asked here a few days ago, we may find it via google Look to the post from Fokke!
  22. I'm a old bloke and doesn't get really disappointed by this. But sometimes it seems to be helpful to raise the voice and threatening with the finger. You normally publish much, much better work! If you are interested in this EXIF stuff, you should get you ExifTool, a (platform independant) Perl library. Here a download from heise, - and there is also a GUI available for Win and there seems to be some kind of GUI for Mac too. You can manipulate all Metadata with it, what enables you to create a good set of test images. Also don't forget to throw in some gif and png into your test set. ------ Above I have tested your 0.4.0 version. The enhancements with 0.6.0 is nice and useful. The best experience for the users would be if they can pass a single keyname or an array with keynames to the get method, I think. Then it return a single value or an associative array / or object. This module, once it is stable, or close to stable ;-) , it can be used directly in templates but also in other modules to read data and maybe write it into fields, for example on images upload. If you make it robust, it can (and should!) become the dependency for all following modules that want to handle EXIF data.
  23. @Nico: I have installed it, but it was hard to get it returning some data for me! There are some really heavy faults with your module: you need to check image type before passing a file to exif_read_data, please test with png and/or gif and set debug to true! there is no error handling, null, nix, nada. With some jpeg images I get: Warning: exif_read_data(motiv_wood.jpg): Incorrect APP1 Exif Identifier Code in .../site/modules/ImageEXIF/ImageEXIF.module on line 29, and then there is no retrieved data available! there are tons of PHP Notices regarding undefined indexes! depending on available data in the exif headers. there are also no checks for any of the needed APP marker (EXIF, IFD0, FILE) Some minor issues may be: when my original data for FocalLength is "107/25", you return me: focalLengthUnformatted = 4.28 and additionally focalLength = "4.28mm". For what is this useful? I would expect that you give me: FocalLengthIn35mmFilm = 35, regardless if added "mm" or not. That one is commonly important but missing. I get returned this: comment = "ASCII\x0\x0\x0© John Doe", The \x0 are binary NULL, what truncates any following string data! This way the users of your module never will get their UserComments returned. But exif_read_data already computes this to: UserCommentEncoding = "ASCII" and UserComment = "© John Doe". Why don't you use that when already returning filtering and manipulating data? a micro-issue: is returning the mimetype useful? It only can be image/jpeg, or what else? there is more, but I become more and more angry ... Nico, it is signed "BETA, close to stable" in the directory. This is a joke, no? Maybe the cool kids today do not need testing / debugging anymore? I don't mind if anyone personally like to jump out of an airplane flying 10.000 feets high without using a parachute. But I'm really angry if someone throws out other people without them giving a parachute! I'm curious about what docs / specs you have read about EXIF and about how many people already have tested this (besides you) before you uploaded this to the directory as "close to stable"? I would have expected that you turn on debugging when developing a module for the public and also would have expected that you first post it here into the forum as alpha module. But most of all the usage of errorhandling! Thanks for reading. I will review your next release if you like - but not when it is missing the above mentioned things. ------ PS: here is a good summary on the subject in German: http://www.dslr-forum.de/showthread.php?t=131920
  24. @Nico: Hey, a new metadata man! I have had a quick look to it, not installed and tested yet. But I already spotted a few lines where I may suggest to test if function_exists("exif_read_data") in/before install(), just to be on the save side! there are a ton of possible data names outside in the wild, actually you have cut them down to a more or less small set of the most needed ones, but if for example a photographer uses / needs some that you have not in your list, the module is useless for him. I recommend to add the ability to access the raw data as object, unfiltered, not cutted, etc. What I really like is that you just read the information from the original imagefile on demand and do not try to store/cache it elsewhere! ALso really nice for me is the Line 88, your comment on this. For me, that I do not use / need EXIF-data at all, this is the one and only important information from all that EXIF-data. It tells us in which direction the camera was turned when taking the shot, for example. (have a look here and here, followed by 985 and 1000). We use it to autoRotate images where needed.
  25. Hi, Only thing I can think of is: it is sent via POST when you press the save button, so you may check the setting for post_max_size. With enabled DevTools in your browser you may easy be able to read the amount of sent POST-data. PS: a good setting for max_post_data is 240M when the upload_max_filesize is set to 200M
×
×
  • Create New...