Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. 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
  2. Do you have updated PW version to 2.5.9 ?? Also switch back to default Admin Theme! just as a test!
  3. 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.
  4. 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.
  5. 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!
  6. 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.
  7. @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
  8. @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.
  9. 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
  10. They want you to create and upload a single TAR archive with the whole site? Do you have no FTP(ES) or SSH access? You need to use a tar-archive software, what depends on your system where the site resides at the moment. (or you first download it from there to your local PC via FTP) If you have a commandline util, google may be your friend to find the right params: https://www.google.com/search?q=tar+pack+directories+and+files If you can use 7-zip, it lets you select from different output formats, including tar. (it seems to be mainly for windows but also has downloads for some linux distributions at the end of the download page) Regardless of the tool, I think what is important is to check if the files and directories have the right permissions after unpacking at the new host, especially the assets folders!
  11. You may use Textformatter HannaCode and build a little tool for your clients, so that they can use something like []? And additionally you can add Textformatter EmailObfuscator after the Hannacode to make it harder for harvesters?
  12. Thanks @Hari, great that you have solved it, at least a bit. Regarding the timeout issue, is it right when I'm saying: "As conclusion we have found out that when uploading many images to a cropimage field with multiple cropsettings every thing works fine because every single image is handled in its own (php)-thread. Backend and Frontend work as expected. Later on, when changing the initial cropsettings, there must be a point in code where the imagesizer is called for all changed variations of all images but in a single (php)-thread. Therefore it can run into a timeout." I need to find that point what must be a loop, - there we need to add a set_time_limit() within the loop to avoid those timeouts. Update: I think it has to be in this line: InputfieldFile.module#L212. I will test this when have a bit time for it.
  13. Sorry, but just to clarify: And finally the real culprit is the person who has added it to the config when the installer has asked for informations how to access the DB. What I want to say is that there are more cases possible than only "localhost". (e.g. another hostname, an IP, different than 127.0.0.1, regardless if you run a mysql server on the same machine or another, etc). But it is really helpful to add information here that changing a named host, e.g. "localhost", to a IPv4, e.g. "127.0.0.1" can help speed up things on systems that are configured to use IPv6 at first. Many thanks, and sorry for kidding.
  14. Hi @Hari KT, thanks for the info. A few more questions: You have uploaded the 40 images without running into timeout, right? You only get a timeout later when trying to edit the page? How many crops have you defined for that cropimage field in setup -> fields -> imagefield? I mean the total of all crops, regardless if you have bound some of them to specific templates. (can you drop the settings into your answer, that way I can see the dimensions too) Do you have changed the settings for that field after you have uploaded the 40 images to your page? Can you enter the page edit with another role / account, not superuser? How does it behave? (same as superuser or does it have all imagevariations ready to display?)
  15. What's about: $page->parent('parent=' . $page->rootParent); // $page->rootParent returns $foo as Page, not name, not id just for the case that the name of foo will change in future, or: what is about usage in a multilanguage site?
  16. @wanze: this may depend of the increased or somehow changed usage of modules cache since PW 2.5. @Isag: Just for testing: I would try to hit refresh in the modules section manually. And then give it a new go. @wanze: Maybe you can add a $this->modules->resetCache(); to the first line of your install routine? @Isag: which PW version you are using? PW 2.5.??
  17. @Hari KT: There is no special handling with images cache if a user is logged in as superuser or not. Can you provide some more info? Which kind of imagefield do you use, the core or the cropimage? How have you added the images to the field(s) / page(s), via API or via the Inputfield in backend and uploading? How many images (in numbers) are "lots of images"? 50, 100, 500, 1000, ...? Also, do you have one imagefield per page or multiple fields? If you have multiple fields, how many images are in total on a page? It does not try to recreate images when viewing from the frontend, no? Only when in backend, opening a page for edit? Do you (have) use(d) somewhere in your templates or elsewhere code that calls $pageimage->removeVariations()? Without further information I cannot say much to this, only guessing that you may have added images via API and opening a page for editing the first time in Backend.
  18. Spex + AIOM Page Path History Form Save Reminder Maintenance Mode Diagnostics (+ Dependencies for Webserver, PHP, Database, Files, Imagehandling)
  19. You are missing the second / third argument with the addHook call! 'Pages::setupPagename' $this 'functionName' Also I'm not sure if you can use anonymous functions like you have done. Why do you do want to do this? Is there any advantages over the "normal" method from the docs and the examples? Have you tried it the other way too? public function init() { $this->addHookBefore('Pages::setupPageName', $this, 'functionName'); } public function functionName(Event $event) { ...
  20. I'm pretty sure that those things can be done already. Styling the Pagetree can be done with a CustomModule like here: https://processwire.com/talk/topic/5609-display-a-template-icon-base-on-date-field/ And to get a list of all pages by certain criterias (template, parent, empty fields etc.) can be done with Find / Lister:
  21. Ah, yeah, now after putting on my glasses I see that you have written "config file". This, (reading without glasses) and the fact that I'm currently working on a little autoload module that tweaks $config (only the variable / object, not the file content) was enough to make me not seeing / thinking clear. (This has nothing to do with the bottle cognac whose content decreases continuously here.)
  22. You makes me curious and/or puzzled.
  23. Hint: https://processwire.com/talk/topic/142-make-session-start-in-session-overridable-from-a-module/#entry1002
  24. Hi, actually no. Imagick is a PHP_extension that is used as layer between PHP and ImageMagick, this way ImageMagick can be used on shared hosts without the use of the exec() function. I don't know graphicsmagick, only have heard the name. Is it used by calling through exec(), like ImageMagick, NETPBM, and others? Horst
  25. @Mary: do you have uninstalled the core module before you installed the CostumModule? There may be chance that are settings in the modules cache that need to be refreshed after you have deleted it manually. Does the Frontend work? If so, you can simply add a line of code to force a refresh of the modules cache: wire()->modules->resetCache(); If you also cannot use the frontend, you may simply empty the DB table named "caches". (Do not delete the table, but delete all of its records). If this doesn't change the 500 Error, do it again and also check in the table named "modules" around the last entries, (when sorted upon field created), if there exists an entry for your manually deleted CostumModule. If yes, drop that record. Now try to go to the admin again. HTH & good luck. BUT, BEFORE you start with manipulating the DB, please make a backup!
×
×
  • Create New...