Jump to content

horst

PW-Moderators
  • Posts

    4,077
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Hi @leoric, I assume the error occures on the imagefield named watermark as you can use the pimLoad method with the field named images. Here are a few questions: Does your template / page have an imagefield with (exactly) that name? Is this imagefield set to accept only a single image?
  2. The Date header what is sent together with the emails is configured this way: date("D, j M Y H:i:s \G\M\T P") It results in the current GMT and the local difference in P. AFAIK that's the common way according to the RFCs. logActivity isn't meant to hook into. But you can get data from the logfile with tail() or something. The logfile is under $config->paths->logs . WireMailSmtp::LOG_FILENAME_ACTIVITY . '.txt'
  3. @nfil: just a quick thought: you may try to use the file:/// protocol (with three slashes), e.g. echo "<TD WIDTH='25%'><img src=\"file:///{$someImgThumb->filename}\" width=\"{$someImgThumb->width}\" height=\"{$someImgThumb->height}\" /></TD>"; Haven't tested and don't know if it can work with mpdf, - just a quick thought.
  4. When trying to resize this image it seems to have a transparent color at index 126. But it hasn't one. To avoid an errormessage with those inconsistent gif images we can suppress errors from the ImageColorsForIndex function by precede them with an @ char: $transparentColor = $transparentIndex != -1 ? @ImageColorsForIndex($image, $transparentIndex) : 0; Calling ImageColorsForIndex with an inconsistent $transparentIndex returns FALSE, so with the next line in code both cases, FALSE and 0 (zero) work as needed: if(!empty($transparentColor)) { I will send have sent a PR to Github. @Can: commenting the line is not necessary
  5. @Can: This line inspects your gif image for a transparent color (index). The Errormessage says that the image has a flag that told the function its transparent color index is the color at position 126 in the colorpalette. But the colorpalette seems not to have that much elements. Can you send me this (original) image so that I can inspect it? (info at nogajski dot de) To comment that line will destroy transparency in GIFs. So this is not an option. Maybe we need to do more in depth inspection for gifs if they have set a flag for transparent colors. But also it is the first time that someone report such an error. Sounds to me like a sort of inconsistent gif image.
  6. Hi rickm, This is recognized when images are resized. We want not to overwrite the original files with the GD-lib, because it would erase all metadata and even can modify the original image data significantly! So all variations created by ProcessWire are autoRotated correctly. If this doesn't work for you please check in your site/config.php the setting for config->ImageSizerOptions["autoRotation"]. (sent from mobile)
  7. @Soma: many thanks for these mods. Works like a charm in configpages now!
  8. Have try (tried?) some more and found that the defaultValue do work with a little change inthe code: https://github.com/somatonic/RangeSlider/pull/1 But the main question is when using it in a modules configpage like in the above post, how can I get the result stored into the config-data? Is this possible?
  9. Hi, I want use this with PW 2.4.+ in a Modules-Configpage. Is this possible? EDIT: yes it is possible! I have tried the following code but I do something wrong, the slider isn't displayed in the config page: EDIT: The settings for minValue, maxValue etc. belongs to the $field, not to the $slider. This was what I have done initially wrong $field = $modules->get("InputfieldRangeSlider"); if(!empty($field) && class_exists('RangeSlider')) { $field->attr('name', 'integer'); $slider = new RangeSlider(); $field->attr('value', $slider); $field->width = 90; $field->minValue = 1; $field->maxValue = 100; $field->defaultValue = $data['integer']>0 && $data['integer']<=100 ? $data['integer'] : 50; $field->step = 1; $field->label = 'Test with integer value'; $fieldset->add($field); } else { ... The only thing what is not working is the $field->defaultValue, - what I'm doing wrong here?
  10. Hi Jonathan, many thanks for adding this and your help to make all image related modules work smoothly together. Passing third-party-options along with images is a very new feature. It has changed in the current dev-branch if I remember right around 2.4.2 or 2.4.3. Unfortunately 2.4.0 doesn't support third-party options like the current dev-branch does. With the 2.4.0 you only can get / set the original quality for the imagesizer, but nothing more. With the comming soon 2.5.0 or current dev-branch, one way to get / set the imagesizer options (including our third-party ones) is to add another hook to the init function: $this->addHookBefore('ImageSizer::resize', $this, 'imageSizerResizeBefore'); And in the imageSizerResizeBefore method you can get / modify / set all options. The first thing should be to look if optimize should be skipped, if so, one can set a flag that will be read first by the imageSizerResizeAfter method too. public function imageSizerResizeBefore($event) { $imageSizer = $event->object; $this->skipOptimze = (false===$imageSizer->useJPEGOPTIM) || ($imageSizer->getImageType() !== IMAGETYPE_JPEG) ? true : false; if($this->skipOptimze) return; // this one can be called in the [font=courier new,courier,monospace]imageSizerResizeAfter[/font] method too // read all options and settings from the ImageSizer-Object $this->filename = $imageSizer->filename; //$this->extension = $imageSizer->extension; //$this->sharpening = $imageSizer->sharpening; //$this->upscaling = $imageSizer->upscaling; //$this->cropping = $imageSizer->cropping; $this->quality = $imageSizer->quality; $this->keepICC = $imageSizer->keepICC; $this->keepEXIF = $imageSizer->keepEXIF; // modify options for the resizing $imageSizer->quality = 100; $event->object = $imageSizer; // is this all what is needed to set, or do we need to set a $event->return too } The above code isn't tested, just written in the browser and parts copy-pasted from another module of mine. The PR for supporting read / write customer suffixes with image variation names is pending. Looks like it will be added soon (before releasing 2.5.0) I there is more you need to know or I can do, please just ask.
  11. @JanRomero: It's really nice that you help, - but your example isn't correct, at least for fields with multiple images, what is the default. Your example only works if the image field is set to accept only _one_ image, and not _multiple_. With multiple imagesfield, you need to specify the image you want to use, e.g.: $page->images->first()->url $page->images->last()->url $page->images->eq(0)->url // is the first image $page->images->eq(1)->url // is the second image etc. have a look at: http://processwire.com/tutorials/quick-start/images/ http://processwire.com/api/fieldtypes/images/
  12. Hey nikola, many thanks for the update! attached screenshot is a page with cropimage inputfield, - there is the color and background-color of the image-title both dark.
  13. @peterfoeng: this is great. I have seen that you already sent a pull request that should solve one or two issues. (I haven't tried it yet) The development and maintaining of this is open to all but write access to the repo should be limited to few people only I think. In the past Owzim and I have successfully and efficiently colaborated on some enhancements to the thumbnails module and he has good skills in js and css. Therefor I really would like if he join in here. Regardless of this, any help and contribution is highly appreciated. The best way to go, (I think), would be to do this for the current module: - PullRequest from PeterFoeng And after that we should start a fork with: 1) creating the clear naming convention for this module, like Antti has suggested (and Owzim). 2) Actually pending is an enhancement to the images naming scheme that supports custom-suffixes and assistant method(s) to use that. After we know how it is finally implemented in Pageimage we will use this in the new fork of Thumbnails module. That allows us to strip out hooks and code for deleting variations. (this is delegated to the core pageimage by the custom-suffixes) 3) Also pending is an enhancement to the imagesizer that allow a "crop before resize" manipulation with individual and exact coordinates. (The default behave is first resize and crop after) With this supported, the thumbnails module can delegate the complete imagemanipulation to the ImageSizer. This will allow to further deleagte it to any dropped in PageimageSizerModule without any additional interaction. If you decide to use another image rendering engine (currently only the PageimageSizerImagick is available) you simply install this and it will work for all image variations, regardless if they are requested by the core Imagesizer or by the thumbnails module or by any other future third party module. fixing known issues: 4) I have tried to use the settings with 0, but it doesn't work for me with height set to 0. I tried these settings: thumb1, 0, 200 thumb2, 200, 0 The first works as expected, the second doesn't. It always displays the full image and when I open the crop-page I do not get an Rectangle. 5) When setup thumbs bound to templates, uploading a new image to a site with one of these templates creates also variations that are only bound to other templates 6) When upscaling is set to false in the config.php, it isn't respected by the CropRectangle. For example if there is a setting 200,300 and upscaling is set to false, the rectangle should not go smaller than 200x300, because if a smaller rectangle is allowed, the resulting image would need to be upscaled, what isn't allowed! Make the CropRectangle respect / reflect this. After these steps we should try to implement some of the requests already posted here: - thumbnails admin Grid View - support for Retina Variation @2x - copy cropped variation to other field(s) / using it within RTEs - and others that I haven't recognized yet
  14. Oh! - Antti, many thanks for asking me, - but due to my lack of css and js knowledge I would not do it alone. Maybe you / we can ask Owzim if he is interested in this too?
  15. @Shebaz: thanks for that nice addition. I have tried to use it but it doesn't work for me with height set to 0. I tried these settings: thumb1, 0, 200 thumb2, 200, 0 The first works as expected, the second doesn't. It always displays the full image and when I open the crop-page I do not get an Rectangle. ----------------------- @apeisa: Antti, I've found two minor issues: 1) When upscaling is set to false in the config.php, it isn't respected by the Rectangle. For example if you have a setting 200,300 and upscaling is set to false, the rectangle should not go smaller than 200x300, because if you allow a smaller one, the resulting image needs to be upscaled, what isn't allowed. If you try a thumb_w0, 0, 300 and drag the rectangle smaller than 300px height (and you have set upscaling=>false) it results in a image smaller than 300 px height. This is not the expected result and may disturb layouts. 2) If I setup a total of 11 thumbnails for 3 templates: th_max_2, 1200, 800, template3 th_max_1, 600, 400, template3 th_mid_2, 900, 600, template3 th_mid_1, 450, 300, template3 th_small_2, 600, 400, template3 th_small_1, 300, 200, template3 thumb_4, 1600, 1200, template2 thumb_3, 1200, 900, template2 thumb_2, 900, 600, template2 thumb_2, 600, 400, template2 thumb, 240, 240, template1 When on a page with template1 uploading an image it creates 11 variations, but only one is needed / used on this page.
  16. hhm, weird. - Maybe try to completly unistall / delete the thumbnail modules and do a fresh download & installation?
  17. @Can: please can you check and report back the following? - which PW-version? - what are the params for this thumb (name, width, height[, options])? - is this the same behave with all images, or only with some?
  18. ... and if PHP needs something like exec() (shell access) enabled what is mostly not with shared hosts and php embedded as apache module.
  19. Ok. I have downloaded and installed it too. I'm on windows and it doesn't load. It's like @Manfred said, in the Line 55 in core/AdminTheme.php :: init() $this->wire('page') does return NULL and not a pageobject for the AdminThemeModesta. For another AdminTheme-Module it returns a pageobject. Comparing both modules shows that both use the exact same code in methods init() install() getModuleInfo(). Weird!
  20. Check if this is in the modules info: public static function getModuleInfo() { return array( // ... 'autoload' => "template=admin", // ... ); }
  21. I don't know if there are any blocks for listeners / viewers outside of germany, hopefully not: Tim Isford Orchestra with John Grant (Haldern Pop 2011) :: http://http-ras.wdr.de/tv/rockpalast/live/2011/haldern11_tim_isfort_orchestra.mp4 Get Well Soon (Crossroads 2013) :: http://http-ras.wdr.de/CMS2010/mdb/15/150912/rockpalastgetwellsoon_1484112.mp4 Haldern Pop 2010 (Review) :: http://http-ras.wdr.de/tv/rockpalast/live/2010/haldern10_feine_kleine_dorfmusik.mp4 Calexico (20. Rocknacht 2006) :: http://http-ras.wdr.de/tv/rockpalast/live/2006/20_rocknacht_calexico.flv Brian Auger Trinity feat. Savannah Grace (Crossroads 2011) :: http://http-ras.wdr.de/tv/rockpalast/live/2011/crossroads11_02_brian_auger_trinity_web_l.mp4 Willy DeVille (2008) :: http://http-ras.wdr.de/tv/rockpalast/live/2008/willy_deville.flv Frank Turner (Reeperbahn Festival 2010) :: http://http-ras.wdr.de/tv/rockpalast/live/2010/reeperbahn_festival10_frank_turner.mp4 Miller Anderson Band (Crossroads 2010) :: http://http-ras.wdr.de/tv/rockpalast/live/2010/crossroads10_01_miller_anderson_band.mp4
  22. On many hosts / shared hosts this is installed already. If not, you need shell access or need to ask your hoster to install it. But another thing is that you need PHP with enabled / allowed exec() function. In shared environments this function mostly is disabled / forbidden if php runs as a apache module, but is allowed if php is running as (fast)cgi. Maybe a check for exec() should be done by installation.
  23. @Jonathan: Hi, it's me again, - I have some more thoughts / suggestions If someone want to use your optimize module and simply the ImageSizer (or any replacement of it), it's just fine as is. But if someone want to use the PageimageManipulator and the Optimizer, the option to temporary suppress the Optimizer is needed: $image->pimLoad('prefix')->someManipulations()->pimSave()->width(300); // this works fine, no need to suppress the optimizer $image->width(300)->pimLoad('prefix')->someManipulations()->pimSave(); // this doesn't work, we need to suppress the optimizer in the width(300) call! // we only want to optimize the final variation and don't want optimize intermediate images Next points all regard to pageImageOptimize() / pageimage::optimize(): With the initially module, the pageimage::optimize() was made for original images only. To preserve the original source (for quality etc) you create a variation with a name like basename.jo.jpg. That's all perfect. There is only a little issue: with the .jo in the name of the variations they get not fetched by the pageimage variation collections. As a result, when deleting / removing original images, these variations would stay as orphaned files. So, I know there is currently no way provided by PW to solve that (But there is already a private discussion with Ryan on how to provide a good support for custom imagefilename suffixes) As a quick (but bit clumpsy) workaround, you can change the .jo by a .0x0 - This matches the current used regex of the variation collections and isn't a name that could already exist. Not only after the use/need for the temporary suppression of the optimizer, there are application cases where someone need / want to call pageimage->optimize() not only on original images. For example when working with the PageimageManipulator: $image->pimLoad('prefix')->someManipulations()->pimSave()->optimize(); // here simply the existing file should be optimized, no need for a new variation name or a new pageimage object I have updated the pageimage::optimize() to recognize original images vs variations and act upon that. If the basic usage supports individual options per image, the optimize hook needs too: $options = array('joQuality'=>80, 'joThreshold'=>30); $image->optimize($options); ----------------- Finally some thoughts about how the different Pageimage modules could work together - If you implement support for PNG too, a name change to something like PageimageOptimize (PageimageOptimizer) would be useful. - Could it be useful for the average user that you do a check against the ImageSizer quality (hook)-before resizing? And if there is no individual setting, temporary set it to 100%? This way an average user do not have to know all about how it works best. And all users can save some code writing, no need for: $options = array('quality'=>100); $image->width(300, $options); just type $image->width(300) and get the best possible result. - with the PageimageSizerImagick (formerly known as ImagickResizer), the user can choose what type of metadata he want to keep, EXIF, XMP, ICC-profile. XMP isn't supported by JpegOptim, but the others too. Would it be useful to support these with the Optimizer? I can imagine that both modules have their own global settings in their config screens, but both check for individual settings on a per image basis: $options = array('keepEXIF'=>false, 'keepICC'=>true); $image->width(1200, $options); $image->optimize($options); I think their will be some more Sizers in the future, PageimageSizerImageMagick, PageimageSizerNetpbm, PageimageSizerWhatever and all of them should support and use the same options where possible. This way a user can write code for image handling independent of the image rendering engine. What do you think about this? I know its much at once and I have a bit of a guilty conscience to push so much stuff here. But I think it is needed that the existing and future image modules work well together and just by installing / uninstalling them.
  24. something like this? : https://processwire.com/talk/topic/4730-page-list-fields-customisation/ http://modules.processwire.com/modules/markup-custom-page-list/
×
×
  • Create New...