-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Yeah, I remember back 15 years or some more, - we have compressed very large images with jpeg quality 1 to a minimum filesize and have send it per Email to recipients where the needed RAM of the uncompressed image was higher than their available system memory!
-
@MadeMyDay: I think filesize doesn't matter, like owzim said: important is the needed RAM for the uncompressed image. @owzim: I think you are right (to 95%), but the timeout can matter too. EDIT: @MadeMyDay: PHP: settings for post_max_size & upload_max_filesize can be an option! (If the customers / clients and their coworkers ignore advise, you have to push them harder!)
-
@MadeMyDay: ok, you may look here and try it if it solves your issues too: http://processwire.com/talk/topic/3718-lots-of-images-to-resize-timeout-in-frontend/?p=36291 (this post and above) Also have edited first post! (php memory usage!)
-
Hi MadeMyDay, you can define allready a max size for uploaded images in the admin for the (crop)-images field under setup fields (your image field) input: This way there is only one resize with the big image version. Following resizes are faster. EDIT: Additionally you may try to bump up the allowed memory usage for php to 128MB or 256MB: in htaccess: php_value memory_limit 128M or 256MB
-
Other then in imagemagick, i don't see a ton of functions and filters in there I think to autoadjust something there is always a portion of guessing with it - or 'out-rider' pixels that screw up or down the autoadjusted result into false directions. I never use such tools without a manually visually control. Also with captureOne and photoshop I do not use those with batch editing.
-
A bit Very bizzare! - So, if he (the author of json.org) doesn't know: what maybe good for one maybe evil for another one at the same time.
-
@soma: I think not seriously. (I haven't heard of that.) https://www.google.com/search?q=gd+php+autoadjust%3F
-
hoi, there are now two 'unplanned' additions in the Version 0.0.5: canvas($width, $height, $bgcolor, $position, $padding) $width = mixed, associative array with options or integer, mandatory! $height = integer, mandatory if $width is integer! $bgcolor = array with rgb or rgba, - default is 255, 255, 255 $position = one out of north, northwest, center, etc, - default is center $padding = integer as percent of canvas length, - default is 0 unsharpMask($amount=100, $radius=0.5, $threshold=3) // its the same like the method in Photoshop, credit goes to: Torstein Hønsi for the unsharp mask algorithm (created in 2003 - p h p U n s h a r p M a s k)! ..., can create better results than the default stepResize!
-
@diogo: width & height & BG as rgba is ok! But for what is x- and y-position? I have thought one want to center it into the canvas. If you think it make sence to position out of the center, I think it could be better to use the north, northwest, center, etc position and a $padding (I would prefer in percent), that would be most consistent way with other methods. What do you think?
-
@soma:
-
Oh no, - so - for what is the ->rename() method useful ?
-
Hi diogo, if you believe it or not, I have thought about this allready. And I have something like this in an old image lib of mine. I will look at that code and port it to the IM. I think best way is to define dimensions of a canvas in that the previous created image is centered. That way one can get only the horizontal or only the the vertical bars, or surrounding ones.
-
I think it also could be a bit shorter because of the $image->rename() method: $old_name = 'lizard.jpg'; $new_name = 'wizard'; $p = $pages->find("image.data=$old_name")->first; $p->of(false); // outputformatting off, single and multiple image fields are from now on wire array's // get the image and the extension $page_image = $p->image->first(); $ext = $page_image->ext; // pathes and old file basename aren't needed because we cannot leave the pages assets directory! $newFilename = $new_name .'.'. $ext; // only rename, copy and remove isn't needed $page_image->rename($newFilename); $p->save(); only written in browser, not tested, but should work, i think. EDIT: Have now tested and I'm afraid too: - it doesn't work!
-
with a pageimage loaded into the {Pageimage} {Manipulator} you are not able to overwrite the original! You have to use the {Image} {Manipulator} manually with a filename. Here you can do everything you want, - or the opposite: you alone are fully responsible for _all_ actions, ;-) $pim = $wire->modules->get('PageImageManipulator')->imLoad($imageFilename, $options); // here it is used imLoad = image manipulator instead of page image manipulator If you do not specify an alternate filename or outputFormat with the options array, the sourcefile loaded into the IM is overwritten by default! Note: if you overwrite your original image, you wipe out all EXIF-data, whereas all IPTC-data is kept! ------------- Hey Soma, it looks like you are building a visual Photo-Editor based on PW. cool!
-
and what is the output from: var_dump( $img->pimLoad("bright")->getImageInfo() ); // what is the output here
-
@soma: does the imageSizer work with the images? $img->width(240) or $img->size()
-
hhm, very mysterious. When I use your code I get a new image! I assume you have get the latest version of the module, tried a new install already? What do you get when you use: $p = wire("pages")->get(1111); $img = $p->image; echo '<p>' . $img->url .'</p>'; echo '<p>' . $img->width(240)->url .'</p>'; // does the imageSizer work with that image? echo '<pre>'; var_dump($img->pimLoad("bright")->getImageInfo()); // what is the output here echo '</pre>';
-
it must be $img->pimLoad("bright_") EDIT: to the 'minor things' I will have a look later and report back here, promised
-
The module is updated to version 0.0.4 and is available in the modules section now: http://mods.pw/5E There are no other additions planned! (So there should be some improvements done for a final stable version 1.0: all logging and errorhandling should be made ready for translation, but this isn't scheduled yet)
-
For me it was very convenient to find TortoiseGit. It is based upon TortoiseSVN what was forked from TortoiseCVS which I love and use since 8-9 years now. All the TortoiseXXX forks uses the powerful and deep Shell- and WindowsExplorer-Integration from the TortoiseCVS developers. (one more thanks to that guys!) On the TortoiseGit site there is a link to a download location and a SetupHowTo what tells exactly which version to download and what installation settings are best. For those who are familiar with TortoiseCVS or TortoiseSVN it maybe simpler to get started with GIT(hub) on windows.
-
1) you may do this by using a hidden tools page with an images field and than you only have to use $page->images->add($shotImageUrl) to save the image to the tools page assets directory. And you have it as PageImage and you can do all image api stuff 2) I have uploaded a new module for Image Manipulation. With this you are able to use some well known image methods (width, height, size) and you can store the image together with your xml or json file instead of creating and using a tools page with InputFieldtypeImage. Example (this could be somewhere in your makeRequest method): // get your image from dribble and save it to your cache directory $shotImageUrl = 'http://dribble.com/some/path/to/image.jpg'; $imgCacheFile = $this->cachePath . md5($url) . '.image.jpg'; $result = file_put_contents($imgCacheFile, file_get_contents($shotImageUrl)); // if $result is not false and greater than zero the image was successfully saved, // now you can load the $imgCacheFile into the ImageManipulator, resize it and save it by overwriting the $imgCacheFile $boolResult = wire('modules')->get('PageImageManipulator')->imLoad($imgCacheFile)->resize(360)->save(); // thats all PS: if you want rely on the PageImageManipulator module, you can set it as needed dependency for your module: public static function getModuleInfo() { return array( // ... 'requires' => array('PageImageManipulator'), ); } see: http://processwire.com/talk/topic/778-module-dependencies/
-
Hhm, I have finalized the third WatermarkMethod: watermarkText() (and have uploaded the third and (hopefully) last version of the module: http://processwire.com/talk/topic/4264-release-page-image-manipulator/) But it isn't really what I wanted it to be. It is because GD2 with PHP (at least with version < 5.5.0) doesn't support anti aliasing for transparency! My initially plan was to analyse the source image histogram-data and automaticly set the fontcolor to more lighten or darker. Also I want to have it a bit blurred and transparent. But everytime one define the transparent color for the overlayed textmask, it gets cutted the hard way! (0 = nothing or 1=100%, and nothing in between) I have tried to get a bit around that behave and now it depends on the source images. Sometimes it seems to be possible to use the method, and sometimes it's to ugly!
-
$padding (in percent of the image length), default is 2 (I also have updated the method doc in first post with this)
-
@Raymond: I have uploaded a new version with the positioning added! Let me know how it works. @all: there was a little bug (a 0 instaed of a 1) in the module file at Line 81 that has ignored the forceRecreation param. Please update both files to version 0.0.2 (link is in the first post) Edit: @Raymond: Yes you are right, it is really nice to have the watermark image as pageImage too. I have tried this: $img = $page->images->first(); $wmi = $page->watermark->pimLoad('wmi')->colorize('red')->pimSave(); $imgsrc = $img->pimLoad('tw',true)->width(180)->grayscale()->watermarkLogo($wmi, 'southeast', 0)->pimSave(); echo "<img src='{$imgsrc->url}' /><br />"; and a grayscale watermark becomes red. Nice! Have not thought about this possibilities before.
-
Hey Raymond, thanks for trying this. I will add this like the ProcessWire way with 'n' 'north' 'center' 'c' etc, because of consistency with the ImageSizer. It was already on the todo list because I need it for the watermarkText method too, but currently I'm running a bit out of time. Also I will make the watermark methods accept pageimage and filename for the $pngAlphaImage!