-
Posts
4,085 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Have you tried to increase it in the .htaccess file? php_value memory_limit 128M #php_value memory_limit 256M
-
ok, this way it could be that some different mails has to be sent parallel, right? You can go this way: (simplified) - sentLogReset isn't needed in your case, because you collect all recipients in the field $message->recipients. - you need to hook into sentLogGet, here you read all recipients from $message->recipients. - for each successfull sent message you should drop the recipient from the $message->recipients field in the hooked method sentLogAdd (don't forget to save the page) here you also can add a message to a textarea field Edit: striked the above, - see this post, it has a more correct solution This way it should be possible to add some hundred recipients to the initial collection and if a script execution got interrupted, it could be resumed with the next cron run. The only thing that you have to take care for is to determine if a page is allready sending. (no simultaneous sending of the same page!) Hhm, maybe also it should not send different pages simultaneous?! Only one page after each other? The used php libs allready provide personalized emailmessages in a faster way than to create and encode a new mail for each recipient. So, to use it in its meant fashion, it is needed to extend the current module. If you like and if it is possible that you can send me (only) the basic template code for the emailpages we can achieve that together. Edit: Oh, hasn't read your gists before. Some questions: - Is it possible to setup the cron to only start a new instance if the previous started one (5 minutes before) has allready finished? (but skip it if the previous one is still running) - What would be the max number of recipients you can think of you will be collect for a mail (in the next 2 years) using this approach?
-
Ok, if I got it right, you create a new page for a new message (regardless of single or bulk) you select recipients via asm create text, attach files, etc. then at some point you need to save the page. And now, - how do you execute the send? (scheduled or not)
-
@Macrura: regarding the logging, there are already functions that do the logging into files if you enable it like explained here. If you don't want use the default logging files, you need to hook into the logging functions by e.g. creating a module with your logging functions or by defining the hooks on a template like MartinD described here. But can you explain a bit more how you setup your mail recipients? How many recipients do you use (bulk or single)? If you use bulk sending, do you have an admin page where you initialize the mail sending? (add / select recipients to / from a collection?) Or do you prefer to do this ((partially) hardcoded?) in a template file only? I can write some lines of example code if I know a bit more of your setup. EDIT: regarding the Date Header: https://github.com/horst-n/WireMailSmtp/blob/master/WireMailSmtpAdaptor.php#L351 It simply uses the PHP date function to output the current date-time. But you may try using the php gmdate function instead and look if it solves the issue. You simply need to change date to gmdate in line 351 of WireMailSmtpAdaptor.php.
-
How can this be done? Especially if the domains are used on a shared hosting and the hosting provider has done register it etc.?
-
Hi @neeks, at first: I'm not really sure if you have the same effect as powerfulhorse has had, because he has used a loop through childpages and even has had large amount of processing times for cached images?! Doesn't make much sense, hhm? second: especially the watermarkText method never was meant to be used in bulk rendering. It uses much cpu and memory for calling many memory image copy operations and also inspect images by histograms to autodetect the best used color for the text, etc. So that is a lot of work it does and that is time consuming, - sorry I haven't noted this in the first post here. It was meant for something like showing thumbnails without watermark text on a page and only watermark larger (single) images when requested. Also its text output can be a bit (or very) ugly!?! - If you want add the same text to all images, you should create and use a transparent png with a nice (and maybe smooth) text together with the watermarkLogo method instead. third: you may use and inspect debug timers with your code. If there are no significant differences with images processed later (comparing to images processed first), everything seems to be ok. If you get significantly larger times only with later processed images in your loop, then this can be due to some (weird?) design in PHP? PiM uses the correct code to release and free memory (pointers) for all objetcs / instances, but the PHP interpreter internally only seems to set this objects to zero but do not really free the memory to the system site. Somewhere I have read about a discussion between the PHP Group and others and "the others" said that the PHP devs have said that it isn't necessary to release / free pointers because all pointers and handles will be released / freed at the end of every request, (because the complete php instance is closed / released then). I haven't investigated further on this, and maybe I have overlooked to release some objects. I will take a closer look to it when finding time for it. But don't expect it in the near future. --- On the other hand do I use the watermarkLogo method within a loop on a gallery site where it sometimes create 100+ watermarked image variations [2] at first call of an album page without any drawbacks: $gallery = "<div id='myGallery'>\n"; if(count($page->images)>0) { // display imageThumbs $num = -1; foreach($page->images as $image) { [1] set_time_limit(5); $imageName = pathinfo($image->name,PATHINFO_FILENAME); $imageDescription = strlen(trim($image->description))>0 ? ', ' . preg_replace('/[^0-9a-zA-ZöüäÖÜÄß -]/msi', '', trim($image->description)) : ''; $num++; [2] $gallery .= "\t<a id='uid$num' rel='nofollow' title='{$imageName}{$imageDescription}' href='{$image->pimLoad('full',false)->watermarkLogo($wmPng)->pimSave()->url}'> </a>\n"; ... ... } } $gallery .= "</div>\n"; set_time_limit(20); All source images are max 1000 px and as you can see in the loop I use a time_limit of max 5 seconds [1] per loop.
-
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?
-
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'
-
@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.
-
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
-
@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.
-
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)
-
@Soma: many thanks for these mods. Works like a charm in configpages now!
-
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?
-
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?
-
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.
-
@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/
-
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.
-
@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
-
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?
-
@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.
-
hhm, weird. - Maybe try to completly unistall / delete the thumbnail modules and do a fresh download & installation?
-
@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?
-
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!