Jump to content

horst

PW-Moderators
  • Posts

    4,064
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. EDIT: (deleted because of yellow card) EDIT 2: put backup in, - because referee was to quick with yellow card ------->> original postContent @Petsagouris: I think there is only one possible explanation: the libraries are baken by butchers ... and that's with the sharpening was meant as an example. Read the source of ImageSizer and you will see the other improvements from the community. Than look to the posts of that contributors and, for shure, you should get a clue of the quality level on which they [ work / act / post / contribute ]. U-Turn of the day: first I should go and take their lib, not write an own | U-Turn | now I should go and fix their's. Hey, you are joking!
  2. Hi Raymond, yes watermarking makes sense together with a CMS.
  3. Truth of the day: - WordPress is one of the most downloaded CMS so they must be doing something correctly. - specially for the germans: BILD-zeitung is the most selled Newspaper, so they must be doing something correctly. Yes of corse they will do something correctly, but what does it tell me about the quality / usability of it? --- Petsagouris, I have had two quick views to this lib, and it is like it is with most others of them: 1) sharpening - https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Gd/Effects.php they have 1 pattern! That's that pattern that is into all libs that have sharpening and of corse you can find it all over the web. (php.net usernotes, stackoverflow, etc, etc). With the new addition to ImageSizer we now have 3 patterns (soft, medium, strong). (and they are well tested over a set of 30 images, from lowkey to highkey covering not only most common scenes). Maybe that in a year the other libs have them included too, because they have found them here in PW. who knows And, last but not least: sharpening isn't a _effect_, sharpening is essentially image processing. And there exists more than 20 different common methods to apply sharpening to an image. One of that is added to the ImageEditors sharpening method, it's called multistep-sharpening! So with it we now have 4 different patterns available, and you also may pass an array to the method with your own pattern, if the available do not suite your needs in some cases. (with this the advanced users have much more than 4 patterns that they can apply to an image) I don't know who are the people what have done all those libraries. They may be good or very good developers or enthusiats and they may have done really good work or awesome work, - but one thing is fact: I'm sure there are no photographers with them. ;-) (Don't go to a butcher when you want to buy a bread!) 2) there should be only the basics in it, in ImageSizer and in ImageEditor. But these should be robust and with a high comfort for users who don't know much about image-processing but may expect an equal behave like they know from PW. And with ImageSizer this is allready reached because of The only thing what was really needed and wasn't in there was a good sharpening. There is all in what is needed to do a perfect job with resizing, - regardless of image formats, filenames, transparencies, and what ever. But not more! And ImageEditor should be like that with what could be usefull for most users handling images in an CMS, and not more! At first it should be a tool for module authors who want to deal with images, so that they haven't to go and take a sharpening method from somewhere in the web without really knowing what it does / how it works. They should be able to simply resize an image, and sharpening is applied automatically. (They even have not to know about the fact that images could/should be sharpened when resized, - like I can store some Text into a PW-Page without have to know how a DB works on that).
  4. When working on ImageEditor (formerly named ImageManipulation) I come across some points that I want to [ discuss | get advice | point out ] ----- 1) The ImageEditor now can be used like this: $myImage = $page->images->first; $imedit = new ImageEditor($myImage); if($imedit->imRotate(90)->imResize(300,0,false)->imSharpen('soft')->imSave()) { echo '<img src="'.$myImage->url.'" />'; } It needs a PageImage as source. This can be an original Image, but than it needs a targetFilename, because it doesn't allow to overwrite the original Image! When it gets an ImageVariation it can save to that filename (overwrite). You also may save to another image format, e.g. your source is JPEG and you apply some alpha masking vodoo to it, you want to save it as PNG. This can be done by define the optional option outputFormat. ----- 2) I think there is a need for a additional Image Method: $image->nameAppendix() or something like that because there is allready a naming convention for images ( originalimagename.300x0.jpg or originalimagename.0x300.jpg ) that could be extended to something like originalimagename . 300x0 (userdefinedAppendixWrappedBySpecialChars) .jpg The $image->nameAppendix('userDefinedAppendix') should set or exchange this filename part. This would be of great help to keep imagenames consistent across the site. I have read a thread where Ryan has said that when trying do delete all Variations of a site that cannot be done by iterating through $images and use ->removeVariations() for large sites. On the other hand when users or module authors can name the images without be restricted that may become a mess with imagenames. At least there should be defined a image naming convention with respect to UserNameAppendices, - than I can implement it into the ImageEditor. ----- 3) I need some advice on how to handle Errors & Warnings, e.g. when not all needed options are passed, or they aren't valid. Should we silently use defaultValues where available or should we use that and write to ErrorLogFile. Don't know how fast a Logfile can grow, or even more terrible, - when should I throw an Exception? When gets an admin email invoked? I can upload the code or provide otherwise more informations on that. Please ask / tell what is needed. ----- 4) Here are some examples / possibilities of usage: $myImage = $page->images->first; $imedit = new ImageEditor($myImage); output of $imedit->image : array(10) { ["type"] string(3) "jpg" ["imageType"] int(2) ["mimetype"] string(10) "image/jpeg" ["width"] int(1800) ["height"] int(1196) ["landscape"] bool(true) ["ratio"] float(1.505016722408) ["bits"] int(8) ["channels"] int(3) ["colspace"] string(9) "DeviceRGB" } $myImage = $page->images->first; $imedit = new ImageEditor($myImage, $options); //second param is optional $options array like with ImagesSizer /** * valid options, identical to that 5 from (new) ImageSizer, * width 3 additions: targetFilename and outputFormat * * - targetFilename is needed because we don't want to overwrite the original Imagefile * there are two exceptions: * 1) if you have allready created a variation and have passed that to the ImageEditor * than a targetFilename is not needed. * (we check reference '$image->original' to know about that) * 2) using the static function fileAutoRotation, because this is mainly implemented * for correcting an original imagefile on upload! So a file gets uploaded only one * time and only then we may apply rotation to the original image. * * - outputFormat is optional and only should give ability to * import for example a JPEG, do something with fancy masking and * save it to PNG-Format with alpha transparency. * * - bgcolor may be used when wrapping borders around an image or create Thumbnails like Slides * (squares with landscapes or portraits in it) * */ protected $optionNames = array( 'autoRotation', 'upscaling', 'cropping', 'quality', 'sharpening', 'bgcolor', 'targetFilename', 'outputFormat' ); // you may also at any point get out the memoryimage, apply your own stuff like a SepiaFilter and put it back: $myImage = $page->images->first; $imedit = new ImageEditor($myImage); $im = $imedit->imRotate(90)->imResize(300,0,false)->imSharpen('soft')->imGetIm(); imagefilter($im,IMG_FILTER_GRAYSCALE); imagefilter($im,IMG_FILTER_COLORIZE,100,50,0); $imedit->imSetIm($im)->imSave(); // the OneLiner // this one should get invoked when an image is uploaded public static function fileAutoRotation( $filename, $quality=95 ) // and this one is a present for apeisa, (but pssst, don't tell him) public static function fileThumbnailModule( $filename, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h, $quality=95, $sharpening='medium' )
  5. No, this isn't suspicious, it's me saying skoal.
  6. ( this is the community from Ryans point of view )
  7. Thanks for looking to this Ryan. So may I go to the wishlist and add a 'FieldtypeTextUnique' to it, or is it allready on a list you have?
  8. Thanks Ryan, - but I don't need it now with this module. It was just a to quick asked question. Anyway it's good to know for the future. I will go with the ConfigurableModule. But if one ask here on the forum it maybe that one get to much information for one's brain to handle / process / assimilate. But, just keep on with it guys!
  9. Maybe, but as of Thumbnails is a visual Tool, I wish to have it like in my dirty Hack. plus one additional feature: If you have created a Thumb and quality isn't what you have expected, when you go back to recreate it, the CropRectangle should be placed automaticaly at its place, so you have only to select a different quality and / or sharpening pattern. (Just a dream, - but sometimes they become true)
  10. Ryan, did you find out something about that with the use of the language pack? I'm fine with the default admin theme, but language pack would be fine.
  11. have had some hours last evening (exactly 8 'til now) I think I can finish the import next time I get 2-3 hours. So, don't know when now. There is some trouble with chars in filenames and ID3-Tags that want not get into the DB, so I have played around with sanitizer, but have to go deeper and change the current behave. Here are a screencast of the backend, starting with an empty DB (no mp3 data in it) set one or more pathes, do a quick filesystem scan (without parsing ID3 etc) envoke a command line script to perform scan with parsing mp3 files and pull data into DB: (please look fullscreen or otherwise enlarge Video) https://youtu.be/Re08fuNFRao
  12. Hi Soma, I'm actually working on scanning filesystem and parse 5000 files for metadata. As I run into errors (e.g. not knowing to use $sanitizer->selectorValue()) I don't want to wait 3 minutes every loop, - so store a serialized array in cache-file (site/assets/cache/). I've asked to get a sense for the possibilities. Actually I only will use the ModuleConfigData-storage for some Path- and Extension-strings. Thanks, it only implements ConfigurableModule, so it must have Module allready. (will look into that closer) EDIT: have found this Post: http://processwire.com/talk/topic/1313-modules-process-and-the-difference/#entry11738
  13. Can I also use it with extending Process instead of WireData? class MyModule extends Process implements Module, ConfigurableModule { That's awesome! I will change that after finishing some other parts Is there a limit on size to store? For example can I store a serialized array of 5MB or are any bads with that ? Many thanks!
  14. Ryan, that's great! It's that kind of great things one will find lots when starting to work with PW. In the past there were so much things that couldn't achvied or only with clumpsy workarounds. I just have to learn to think more positive and first try to find the most simplest solution, than look into PW to realise that it is almost in, or sometimes to get surprised that there even is a more comfortable and easier solution than that I could imagine.
  15. Thanks Luis. - so have to say: I only want put together the basic stuff but also want to keep it modular and scalable. For example I personally only use mp3-files but if people use other formats like ogg they should be able to extend the class module for that easily. Maybe with some help it could become really nice and not only poor basic ;-) If someone has good skills on how to build / design / layout admin pages with that UI-stuff it would be really helpful if he/she could design the output for the backend. Also if someone is good with frontend design and want to collaborate that would be great too. I have a really short screencast of what I have done till now, (most of this was learning how to send green or red messages to admin screen, how / where to store config data, to create permissions and roles, and basically how to create a module that has a page in the admin section, ...): https://youtu.be/u_S8ajLkzRI Next steps are to parse ID3Tags, compare file-data with DB-data and import new tracks. Question: is it possible to store arrays or WireData on a page?
  16. Hi Soma, that's perfect for this needs, as I allready create a page for the module, I now also create a childpage for the config data. I have to learn to think less complicated when working with PW! I also have created 2 permissions and 2 roles to have access control. It tooks only 5 minutes for this! (Das ist so geil!) If I have not allready said it: I love ProcessWire!
  17. Hi, I create a little module that extends Process and creates a page in backend under setup. I need to store and retrieve a few (config)data for it, but don't want to make it a ConfigurableModule because than I have redundant places where I can setup config-data , I guess. How can I store / retrieve some data into the place where modules store it by default, but without implementing ConfigurableModule?
  18. Ooh, - now I've got it right: the problem are not the ImagePathes in Textareas but _all_ pathes because you setup different sites like http://localhost/mysite1/ , http://localhost/mysite2/ , ... --- You may use Apache with vHosts and generic names like: http://pw1.machine.local/ , http://pw2.machine.local/ , http://pw3.machine.local/ , ... --- Maybe one could use basic httpd.conf (without http-vhosts.conf) and edit two lines in it: #DocumentRoot "C:/Apache2/htdocs" DocumentRoot "C:/WEBSITES/pw1/htdocs" #DocumentRoot "C:/WEBSITES/pw2/htdocs" and #<Directory "C:/Apache2/htdocs"> <Directory "C:/WEBSITES/pw1/htdocs"> #<Directory "C:/WEBSITES/pw2/htdocs"> to match the systempath of the site you are actually working on? --- or you may have one Docroot and Directory in httpd.conf pointing to for example "C:/Apache2/website/htdocs" and in filesystem you have folders for your sites like C:/Apache2/website.PW1/htdocs C:/Apache2/website.PW2/htdocs C:/Apache2/website.PW3/htdocs and you alter the path to C:/Apache2/website/htdocs for the site you work on. This only needs one edit and Apache restart isn't necessary. --- I go with the vhosts
  19. Hey Macrura, really nice that you want to help out! - But, with this id3 reading and writing stuff I'm allready perfectly equipped. - What would be good to have is functional mp3-streaming code. Playlistgeneration and ServersidePlaying (for win) is already in tha house, too.
  20. Ah, I did know it: it was totally silly! --- I'm not sure, and I've forgotten the Genre-Field, but I think mostly I want to search for an Artist or an Album or a Genre, - or, what would be really nice: want to have 50 or any number random Tracks of specified Genre or Artist as playlist output.
  21. Hi Wanze, many thanks for your suggestions! With the first one I'm not sure how to solve that. The second one would just reflect the filesystem. Not bad, because it's like i use it since ever --- But (maybe it's totally silly): could it be an option to have only one Template (Tracks) with the fields: Artist, Album, Trackname Tracknumber, and some other (tracklength, ...) and one record per mp3file? Or will this slow down PW by searching / sorting? (15 - 20.000 files) (I came up with this when thinking about how to solve your first suggestion)
×
×
  • Create New...