Jump to content

horst

PW-Moderators
  • Posts

    4,064
  • Joined

  • Last visited

  • Days Won

    87

Everything posted by horst

  1. Sorry, have no more ideas. It's up to the pro's here.
  2. Hhm, that's a thing for the pro's. Only thing what comes to my mind is if you use an AdminTheme in your sites-folder you can do one test with it disabled (renamed) to see if the missing elements get suppressed by it. ??
  3. Hi, I'm thinking on using PW to scan my MP3-folders and want ask how you would organize the data. I want to store 'Trackname', 'Artistname', and 'Albumname' & 'Tracknumber', if Track belongs to an Album. (most will do, but not all). I want to be able to do fast (Selector) searches and sortings on combinations of this fields. Any suggestions for a PW-newbie?
  4. replace the complete wire folder with the new one, but keep the sites-folder unchanged (just delete / copy or rename to backup and copy new)
  5. Hi owzim, I'm a bit curious, but you have set up local and online-dev host yourself? If yes, you shouldn't setup them that different when using absolute image-pathes in textareas But to be serious again, - and besides the good solutions from the others on how to adjust it, - you may take a look to somas Images Manager for future projects:
  6. I'm not sure, but could be that you have the last stable PW and this feature you looking for is only in last dev-branch: https://github.com/ryancramerdesign/ProcessWire/tree/dev EDIT: Ok, apeisa is to fast for me
  7. Yes, that's what I've meant with "... if the CSS works 100%". But I think this is not that bad for old browser support ;-)
  8. with IE8 I get 1 JS-Error related to themeforest (unknown var 'marketplace') The Site runs very well (also in a XP-virtualbox). I'm not sure if the CSS works perfectly but nearly 95% it should be.
  9. Hi Wanze, yes with the FPDI extension you can import other PDFs, but in different ways. What I mean with 'as Background' and what I'm find very useful is, for example: You can take a PDF with your e.g. Briefkopf , assuming you have a first page with all your stuff (Logo, adress, bankinfo, tax number, etc.) and a second page with less data (maybe a smaller version of your Logo and only name and phone number), and use it as background-layers: // example use of FPDI-Extension with FPDF. $tplfile = 'C:/fpdf/templates/mein_briefkopf.pdf'; $pagecount = $this->pdf->setSourceFile($tplfile); // defining the sourcefile returns Pagenumber of it for($i=1;$i<=$pagecount;$i++) { $this->fpdiTemplates['tpl_s'.$i] = $this->pdf->ImportPage($i); // import each page and assign it to a variable } $this->Parser_Opened = TRUE; $this->Use_Template = $this->fpdiTemplates['tpl_s1']; ... // write own stuff to the first page // switch the Template to the second page for all // following pages (optional) $this->Use_Template = $this->fpdiTemplates['tpl_s2']; ... // create more pages With the use of FPDI-Templates you can add graphical stuff to your pdf-pages with less effort. On my website one can add images to a virtual lightbox and can download them as a PDF. There are three template pages: one for the image pages, one with my contact-data and copyright notice! and optional one for user notes. ..., und viele Grüße in die Schweiz
  10. Sorry for be a bit OT, but I was wondering when viewing the Forum with IE10 it doesn't realize Linebreaks within the code. Is this only on my machine or have others experienced this too? (I normally don't use IE)
  11. Hi Wanze, great work and very useful! I have one question: do you plan to embedd the FPDI-Extension into it? I know it from working with FPDF. In the past FPDI-Extension couldn't bundled with TCPDF a long time because of the licence, but this has changed a few year ago. Would be useful to upload or otherwise specify a PDF as background on a 'per-Template-Basis'. (<= uh, ugly Denglish)
  12. Hi WillyC, I try to answer in your language: once.need feature.this i will.do u said much.will learn. ready i then .great
  13. PW has roles and users: http://processwire.com/api/user-access/ I haven't done anything with it, (newbie too) but you don't need hardcode anything, but setup roles and userrights to templates I think.
  14. Hi Stefan, $config->imageSizerOptions = array( 'upscaling' => false, 'cropping' => true, 'quality' => 90 ); $config->minify = array( 'hello', 'world', 'some', 'more', 'text', 'end' ); should work.it is equivalent to: $config->minify = array( 0 => 'hello', 1 => 'world', 2 => 'some', 3 => 'more', 4 => 'text', 5 => 'end' );
  15. Actually there is a modified ImageSizer Class available for testing. It autoCorrects Rotation. See this Post: http://processwire.com/talk/topic/3278-core-imagemanipulation/#entry32284 If you have enabled the EXIF-Extension in PHP and it doesn't read EXIF-fields correct, you may have a setup that needs a little tweaking in the php.ini. Search for https://www.google.de/search?q=PHP+EXIF+mbstring In some (rare) cases (on Windows?) the mbstring extension must be loaded before the exif extension.
  16. Hmm, I have checked how this works with the ImageSizer and have seen that there are more core files invoked (at least Pageimage.php, but maybe also ProcessPageEditImageSelect.module). Initially I have thought with writing an ImageManipulation class it could be the central place for all the images stuff. This way all further improvements on it gets automatically into all modules and templates that work with it. Also I've thought we only need to rewrite the ImageSizer a little bit so that he includes the basics from there too. Hhm, - that's my intial thoughts. But, I don't want go into that depth with (other) core files. I'm only interested in getting sharpened images that keeps their original metadata (IPTC) within all its variations. Therefor I decided to implement AutoRotation, Sharpening and IPTC-Support into the ImageSizer-class, (better: into the resize-method) You should extend in site/config.php the $config->imageSizerOptions Array like: $config->imageSizerOptions = array( 'autoRotation' => true, // true | false 'sharpening' => 'medium', // soft | medium | strong 'upscaling' => true, 'cropping' => true, 'quality' => 90 ); As you know, you set global options there, but you also can set options per/image when calling $img->width, $img->height, or $img->size by passing an options-array as second/third param. The options-array needs only key=>value pairs included with what you want to override the defaultsettings and the global-config-settings. Now it's a bit like an ImageManipulatorLITE You may paste this code into a template and call a page that has at least one viewable image: if($page->images->count()>0) { $size = 240; $options = array( // these are the default settings 'autoRotation' => true, 'sharpening' => 'medium', 'upscaling' => true, 'cropping' => true, 'quality' => 90 ); $quality = array(20,55,90); $sharpen = array('soft','medium','strong'); echo "<p>Quality: 20 - 55 - 90</p>\n"; foreach($quality as $q) echo '<img src="'.$page->images->first->width($size++, array('quality'=>$q))->url.'" alt="" />'; echo "<p>Sharpening: soft - medium - strong</p>\n"; foreach($sharpen as $s) echo '<img src="'.$page->images->first->width($size++, array('sharpening'=>$s))->url.'" alt="" />'; } Here is the modified ImageSizer.php for all of you who want to test it out. If you do so and find some issues / bugs / glitches, it would be nice to post it here. (removed zip attachement because it is obsolete) EDIT: I definitely will finish the ImageManipulation class too. But only in the basic PHP way. Actually i have to put in PW-Errorhandling and to do some testing. ---[technical information]--------------- what was modified added properties: protected $autoRotation protected $sharpening protected $optionNames added methods: public function setAutoRotation($value) public function setSharpening($value) protected function imRotate() protected function imFlip() protected function imSharpen() protected function checkOrientation() protected function iptcPrepareData() protected function iptcMakeTag() modified methods: protected function loadImageInfo() public function setOptions(array $options) public function getOptions() public function __construct() public function ___resize()
  17. Oh, yes it should be. (Haven't realised that) Thanks! Edit: haven't seen at first (because of 'Tunnelblick'): Thank you, Soma!
  18. Hi SiNNut, many thanks for the links. There are interesting things to see like using the GD with layers like Photoshop or Gimp. But the GD-related code is allready done. What isn't achieved now is the PW integration. I would like to have it that we can use it like: $img->open($options)->im_rotate(90)->im_resize(700, 0, true, 'medium')->save(94)->url . Don't know if this is possible and if yes don't know how, so thats a big challenge for me. Actually I can do it in the basic PHP way: $manipulator = new ImageManipulation($filename,$options); $manipulator->im_rotate(90); $manipulator->im_resize(700, 0, true, 'medium'); $manipulator->save(94); Edit / Add: Or with the static OneLiner-Methods you actually can check / correct a imagefile: ImageManipulation::file_jpeg_auto_rotation( $filename, 95 ); This checks the EXIF-Orientation-Flag of an JPEG-Image, corrects it if necessary and save it with quality 94. Is useful for uploaded Images.
  19. Hi, I wish to have a core ImageManipulationClass like the ImageSizer but not only for resizing and cropping images. It should provide these easy to use functionality like with the ImageSizer and additionally a step to step image manipulation whereas the user / module author is not restricted anyhow. The basic image manipulation methods should be included, like: im_flip im_rotate im_crop im_crop_auto im_resize im_sharpen im_stepResize If someone want to do something more fancy or magic, he/she should not to have to reenvent the basics again. He/She just should start with the class by opening the imagefile and create a GD-object, use some basic methods, and at any point get the GD-IM-Reference out, do his fancy magic with it and put it back to the class to use its basics to finalise the file: im_get_im() im_set_im( &$im ) I have started to write something for this. I tried to be as close to the ImageSizer as possible, but some differences will be there. Before I've started with it I have done some tests with sharpening, rotating and others. First I've tried to create a module that hooks into ImageSizer, but have figured out that this wouldn't solve most things what I imagine one want to do with images. I have read the code of ImageSizer very carefully and there are allready very good inprovements in it from the community here. Ok, Ryan has written it and done the most work of all, so tribute to him , - adamkiss, interrobang, mrx, teppo, u-nikos have contributed the improvements to it: . I have looked into apeisas Thumbnail-Module and tried adding functionality for sharpening to it. It think he would have liked if there was a CoreImageManipulation class once when he has written the module. Also Soma actually work on a very cool Module where I really would like to see a link/button or some links/buttons for every image that just let you do some manipulations/corrections to them. <hint, hint ;-)> Any thoughts or Meinungen are welcome. --- EDIT: there is actually a modified ImageSizer class with autoRotation & sharpening available for testing: http://processwire.com/talk/topic/3278-core-imagemanipulation/#entry32284 --- Here are an overview of what allready is in, (I post only properties and method names, not the method bodies): class ImageManipulation extends Wire { // information of source imagefile /** * Filename ImageSourcefile */ protected $filename; /** * Extension ImageSourcefile */ protected $extension; /** * Type of image ( 1 = gif | 2 = jpg | 3 = png ) */ protected $imagetype; /** * Information about the image (width/height) and more */ protected $image = array(); /** * Was the given image modified? */ protected $modified = false; // default options for manipulations /** * Image quality setting, 1..100 */ protected $quality = 90; /** * Allow images to be upscaled / enlarged? */ protected $upscaling = true; /** * Allow images to be cropped to achieve necessary dimension? If so, what direction? * * Possible values: northwest, north, northeast, west, center, east, southwest, south, southeast * or TRUE to crop to center, or FALSE to disable cropping. * Default is: TRUE */ protected $cropping = true; /** * Should a optional Auto-Rotation be performed if EXIF-Orientation-Flag is available? */ protected $auto_orientation = true; /** * the default sharpening mode * * @var array with custom pattern or a string: 'soft' | 'medium' | 'strong' | 'multistep' */ protected $sharpening = 'medium'; /** * if extended imageinfo should be retrieved: number of Channels, Bits/per Channel, Colorspace */ protected $extended_imageinfo = false; /** * Extension / Format for resulting Imagefile (default is same as ImageSourcefile-Extension) */ protected $outputformat; /** * Filename ImageTargetfile if $outputformat is different than InputImage (default is same as ImageSourcefile) */ protected $targetfilename; // other properties /** * Directions that cropping may gravitate towards * * Beyond those included below, TRUE represents center and FALSE represents no cropping. */ static protected $croppingValues = array(); /** * Supported image types (@teppo) */ protected $supportedImageTypes = array(); protected $option_names = array(); private $property_names; // Methods to set and get Properties /** * Here you can specify multiple options as Array, whereas with the * single set* functions you can specify single options * * @param array $options May contain key-value pairs for any valid Options-Propertyname * @return this */ public function setOptions(array $options) public function setQuality($value) public function setUpscaling($value) public function setCropping($value) public function setAuto_orientation($value) public function setSharpening($value) public function setTargetFilename($value) public function setOutputformat($value) /** * Return an array of the current options */ public function getOptions() /** * makes protected and private class-properties accessible in ReadOnly mode * * example: $x = $class->propertyname; */ public function __get( $property_name ) // Construct & Destruct the ImageManipulator for a single image public function __construct( $filename, $options=array() ) public function __destruct() public function im_release() // read image informations, basic and extended protected function loadImageInfo() private function extendedInfo_gif(&$a) private function extendedInfo_jpg(&$a) private function extendedInfo_png(&$a) // helper functions /** * check file exists and read / write access * * @param string $filename * @param boolean $readonly * @return boolean */ private function check_diskfile( $filename, $readonly=false ) /** * helper, reads a 4-byte integer from file */ private function freadint(&$f) // the IM's (ImageManipulation Methods) private $im_dib_dst = null; // is the output for every intermediate im-method and optional a check-out for the im! private $im_dib_tmp = array(); // holds all intermediate im references private function get_next_im( $w=true, $h=null ) public static function is_resource_gd( &$var ) public function im_get_im() public function im_set_im( &$im ) public function im_flip( $vertical=false ) public function im_rotate( $degree, $background_color=0 ) public function im_crop( $pos_x, $pos_y, $width, $height ) public function im_crop_auto( $direction, $width, $height ) public function im_resize( $dst_width=0, $dst_height=0, $auto_sharpen=true, $sharpen_mode='medium' ) public function im_sharpen( $mode='medium' ) public function im_stepResize( $dst_width=0, $dst_height=0 ) // static oneLiner Methods that can be called only with a filename passed to them public static function file_get_exif_orientation( $filename, $return_correctionArray=false ) public static function file_jpeg_auto_rotation( $filename, $quality=95 ) }
  20. Ah, ok. Thanks for the link. I've read the example on php docs and yes they use create_function instead of a 'closure' for the same purpose. Thanks too! WP uses a named function within their preg_replace_callback. So this shouldn't be too complicated to achieve. (Will try when there is more time)
  21. Yes, its the so called closure within the preg_replace_callback. Maybe there also could be used a named function as callback, somehow? But I don't really understand what's going on at that point. Edit / Add: Links about PHP closures with versions prior to 5.3: http://stackoverflow.com/questions/2209327/is-it-possible-to-simulate-closures-in-php-5-2-x-not-using-globals http://www.phpclasses.org/package/5484-PHP-Create-closure-functions-for-any-PHP-5-version.html
  22. Hey Nico, really useful module! Very powerful. I've tried out locally (with PHP 5.3), like it very much, but when uploading to the online host it also crashes the Adminpage. When looking to the code, there is only one closure within the preg_replace_callback what relies on PHP 5.3. Is there any chance to change that to a (surely less elegant) code but that also run with PHP 5.2 ? (Bitte, bitte!) Unfortunately I'm not comfortable with preg_replace & co.
  23. Original, just downsized => why ? or how ? directly with the camera ? Anyway, it's like I've expected: original image and "rotated"-MS-Viewer image are identical = checked with crc32 and md5, (hmm, why do I check with both? ) They are right-top oriented as was to read in Exif-Orientation. (the Viewer do not alter the files, it works as expected from a viewer!) The other one was TopLeft oriented, because your software has corrected it. The other stuff you are showing doesn't make any sense in the behave of PW / GD2. When uploading the same image again and again it couldn't differ. Please check the files in your assets/files/--folders. With all files that need to be rotated one have to wait until the mods have find their way into PW somehow. Sorry for the delay. --- Edit/Add: Ronnie, you should go to a fresh clean empty folder in your Windows System. Leave all other files behind. Then take only one picture from the camera, like you have send with the Zip. Make a copy of it, compare / note filesize and last-modified time of the copy. Put the copy into the MS-Viewer. Rotate it somehow and if your done - go to explorer and compare filesize and last_modified_time again. You may also check if there are options with the Viewer what lets you disable the autocorrected display. You may also use an alternative ImageViewer like Irfan-View. Irfan-View has in its Options under JPG / PCD / GIF > JPEG - Load a CheckBox with: Auto-rotate image according to EXIF-info (if available). I have this unchecked. Also I use Irfan-View as the defaultViewer with Windows 7 x64. It's much faster and more comfortable than any WindowsViewer. I have disabled every correction like using ICC-profiles, rotation, etc. It just throws the images to the screen as is, (looks ugly when its a CMYK.) If your camera supports these different settings, try one by one, carefully. I think at least you come up with two versions: 1 with correction and 1 without. Check both of them and compare, best with an ImageViewer that has disabled auto-corrections. After that go to PW, create a new page and upload these two images. Upload them twice and compare. If you have differences with the same images, I give up.
  24. Hi cmscritic, I just want to note that you now have the <h1>-Tag filled with an image, and only with an image. Hhm, dunno if this is a good idea with respect to SEO and page semantic. (But my profession are the images, not SEO or semantic, just doesn't feel good to me)
×
×
  • Create New...