horst

A new Tool! Imagecheck in websites against responsiveness

1 post in this topic


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Cody Connor
      I am currently working on a website in process wire.  I created an image field and added svg as a valid file extension and could upload a png image and a jpg image but when I try to upload a svg image it is stuck loading at 100%.  I figured out that the image field does not take the extension svg even if I add it as an extension. and I was wondering if their is any way to upload a svg image to an image field in processwire?
      I am working with processwire version 3.0.61

    • By louisstephens
      I have been scratching my head on this one for a while, so I thought maybe someone could shed some light on this issue. I am using a grid layout (that I have created over the years) with a class for responsive images (very similar to bootstrap, but very stripped down). Using this, I created a gallery using a foreach loop, and included a "print button" to print each image. I got the classes and everything worked out, but I ran into a small problem with the print functionality. My images (which are around 2400px wide to fill the space) are just fine in the grid and on resize, but when I print, they "run off" the page. I understand that they are just too big to be printed in portrait mode, which led to me think that I could use $image->size(); to print a scaled down version of the image (which adds a bit more load time as now the site needs to load the image large scale and the scaled down version). However, I can't seem to wrap my head around serving just the scaled down version for print only (obviously display:none; doesn't do the trick). Has anyone tackled this before, or does anyone know of a more elegant solution to the conundrum that I have found myself in?
      The Foreachloop:
      $printclass = 1; foreach($page->galleries as $gallery) { $printclass++; $printimage = $gallery->gallery_image->width(600)->url; $out = ""; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<img src=\"{$gallery->gallery_image->url}\" class=\"reimage\"/>"; $out .= "</div>"; $out .= "</div>"; $out .= "<div class=\"row\">"; $out .= "<div class=\"grid-12\">"; $out .= "<a href=\"#\" onClick=\"printCoupon('printable{$printclass}');\">Print</a>"; $out .= "</div> "; $out .= "</div> "; $out .="<div id=\"printable{$printclass}\"><img src=\"{$printimage}\"/></div>"; echo $out; }  
       
    • By Brian Scramlin
      Hey Everyone,
      I have a question that seems like it would have an obvious answer, but I cannot wrap my mind around it:
      If I have 
      <img src="<?= $page->featuredImage->size(800,500)->url ?>"/> in an article template, does my server run a resizing script
      every time someone requests the page? Or, is it resized only the first time it is requested? Or when the page is saved? The reason I would like to know is because I have created two image processing functions my client requires, but one of them is a paid subscription service to compress the images. I don't want to call the paid API every time a page is loaded or something.
      Thanks for fielding my ignorance
    • By evanmcd
      Hi all,
      I've not been able to upload SVGs into a regular image field, with SVG added in the Valid File Extensions field.
      The error I'm getting is:
      Error: Call to undefined function ProcessWire\simplexml_load_string() (line 234 of /var/www/hosts/our_website/Develop/Source/wire/core/Pageimage.php) I tried the ImageRasterizer module, but that didn't fix it.
      Is there a workaround for folks that don't have the simplexml module installed?
    • By horst
      Metadata Exif
      Version 0.9.0  (currently a WIP) for PW 2.8.+ / 3.0+
      This is a new attempt to add easy EXIF reading support to ProcessWire. It should be an easy and less error prone API task. Thats why the module internally uses lowercase key names for all EXIF keys and all of your requested key names. But you are not forced to use lowercase key names, you can use any mixed chars for it as you like. You will get back an array or object with keynames / properties named the same (casesensitive) way as you have passed them in with your request.
      API
      The module adds one hook to the Pageimage: getExif($options = null)
      Without any $options passed to the method, it returns all EXIF data in a RAW multidim array.
      Passing a simple list with requested key names as array to it returns an array with only the values of those requested keynames.
      If you want change the output from array to object, you can use the a boolean "toObject" set to true. Additionally to this and / or any other option, you need to put your requested keynames list to the option "keys".
      $rawArray = $image->getExif(); $options = array('Whitebalance', 'Flash', 'ISOSpeedRatings', 'FNumber', 'UserComment'); $array = $image->getExif($options); $options = array('toObject' => true, 'keys' => array('whitebalance', 'flash', 'isospeedratings', 'fnumber', 'usercomment')); $object = $image->getExif($options);  
      Possible options are
       
      A working example
      $options = array( 'keys' => array('ISOSpeedRatings', 'FNumber', 'Flash') ); echo "<table><tr>"; foreach($options['keys'] as $key) echo "<th>{$key}</th>"; echo "</tr>"; foreach($page->images as $image) { $exif = $image->getExif($options); echo "<tr>"; foreach($exif as $value) echo "<td>$value</td>"; echo "</tr>"; } echo "</table>";  
      This will output something like:
       
      With the boolean option "unformatted" passed as true, the output would look like:
       
      For some keys, that only store something like integer values, what are not very meaningful to most of us, the module contain xyzFormatted methods. This way, it is easy to enhance and maintain the module in the future.
       
      Help wanted
      It would be nice if some of you test the module and report back if the intended API suites your needs. And you are very welcome to post suggestions for which keys you want to have a ...Formatted method.
       
      Thank you!
      https://github.com/horst-n/MetadataExif