Jump to content

Search the Community

Showing results for tags 'resize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 17 results

  1. Hi everyone! So I've been going over all the Animated GIF topics before posting this, but unfortunately I'm none the wiser at the moment. I'm super happy Horst's module has been included into the Core install, but as you might guess...I'm still having issues with my Animated GIFs ? CMS & File checklist: Double-checked if the module is installed = YES Correct upload of GIF = YES Testing GIF has 72dpi & is 1000x1000px & 563kb = Shouldn't cause any problem, right? Uploaded GIF still shows animation in backend = YES ProcessWire is up to date = 3.0.108 Front-end tests: Tried the following code, to see if it had to do with the way I'm resizing, but both with no results. <?php echo $img->width(720)->url?> <?php echo $img->size(720, 0)->url?> Here's the big catch though: If I just echo the $img->url it will show the GIF...so it has to do with the resizing...but this is where I got stranded... UPDATE: Just in case, I also added the PHP & MySQL versions I'm running. Server's online not local. PHP 5.6.32 (in the overview) ----> But it's in fact, when going to the PHP admin, it's running PHP 7.0. Any chance this is what's causing the issue? MySQL 5.6.23-78.1 Any tips?
  2. Inspired by the "max megapixels" option for the client-side image resizer, I made a simple module that adds target megapixel resizing for Pageimages. Image Megapixels A module for ProcessWire CMS/CMF. Adds methods to Pageimage objects useful for resizing to a target megapixel value. Example use You are creating a lightbox gallery of images with different aspect ratios. For the enlargements, rather than setting a fixed maximum width or height you want all the enlargements have the same size in terms of area, allowing a panoramic image to be wider than a square image, for instance. Another use case is sizing a gallery of sponsor logos. The supplied logos are different aspect ratios but you need to ensure the logos are sized so each has equal prominence on the page. The effect of resizing three different aspect ratios by the same megapixel target value can be seen in the screenshot below: Installation Install the Image Megapixels module. API // basic usage $pageimage = $pageimage->megapixels(float $megapixels); // usage with all arguments $pageimage = $pageimage->megapixels(float $megapixels, array $options = []); Example: foreach($page->images as $image) { echo "<img src='$image->megapixels(0.8)->url' alt='$image->description'>" } If needed you can supply an array of options for Pageimage::size() as a second argument. Getting dimensions If you just want to get the height and width dimensions needed to size an image to the given number of megapixels you can use the Pageimage::megapixelsDimensions() method that this module also adds. It returns an array with width and height as keys. Example of how this could be used to output a gallery of logos: foreach($page->logos as $logo) { $dimensions = $logo->megapixelsDimensions(0.01); $width = $dimensions['width']; $height = $dimensions['height']; $width2x = $width * 2; $height2x = $height * 2; echo "<img src='{$logo->size($width, $height)->url}' srcset='{$logo->size($width, $height)->url} 1x, {$logo->size($width2x, $height2x)->url} 2x' alt='Logo' width='$width' height='$height'>"; } https://github.com/Toutouwai/ImageMegapixels https://processwire.com/modules/image-megapixels/
  3. I'm using hook for retrieving data from image metadata (IPTC) after image upload and filling them to some fields. When I choose server-side image resize, everything works well. But when I use client-side resize (which si much faster and client comfortable - it uses PWImageResizer.js) image metadata are lost during resizing - I have downloaded the file after resize and checked for EXIF, IPTC etc. and they are not present. Using PW 3.0.165. Tried to look into PWImageResizer.js but uhh it's too javascreepy to me:)
  4. Hello, my name Marvin, i want to ask something. I'm new at processwire, and still learn it, i try yo showing an image, at a table, the image was show, but i can't resize the image please HELP Here i attach, my code belor <?php $num = 1; foreach($pages->get("/files/")->children as $child) { $current = $child === $page ? " class='current'" : ''; $result = $child->images; // $result->width(900); // $result->height(100); foreach($result as $items){ foreach($pages->get($child->name)->files as $file) { // $file = $child->files; // echo $file->name; echo "<tr><td>".$num++.".</td><td>".$child->title."</td><td>".$child->text_1."</td><td>".$child->text_2."</td><td>".$child->text_3."</td><td><a href='".$file->httpUrl."'>".$file->name."</a></td><td><img src='".$items->url."'></td></tr>"; } } } ?>
  5. Hi all, I'm really new to ProcessWire, maybe I missed the solution in the documentation. I'm working on a site which involves a lot of image upload fields, and I'm always getting many timeout errors. I'm pretty sure it's because I generate too many variations on a single page load (around 20 images with 7 different sizes, for them to be responsive). I can't use ImageSizerEngineIMagick to help (my host doesn't support it). I was wondering if there was a way to hook to the process of client-side image resizing (https://processwire.com/blog/posts/processwire-3.0.63-adds-client-side-image-resizing/) to generate the different variations (as it seems really faster). If not, is there a way to generate the different variations on upload and not on page load ? Any ideas and suggestions are welcome!
  6. Hi all, in the backend of ProcessWire it's possible to define a maximum width and height for images. If you upload an image, it will be resized automatically. I find this feature very handy to safe space. Very often users upload images which are much bigger than needed. On my application users can upload their images via the frontend. But if you upload images using the API, images won't be resized automatically. Is there any way to do this? Currently that's my code: if ($_FILES['thumbnail']['name']) { $upload = new WireUpload('thumbnail'); $upload->setMaxFiles(1); $upload->setOverwrite(true); $upload->setDestinationPath($lesson->video_image->path()); $upload->setValidExtensions(array('jpg', 'jpeg', 'png')); $lesson->video_image->removeAll(); foreach ($upload->execute() as $file) $lesson->video_image->add($file); } Thanks very much! Dennis
  7. 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
  8. Hi, this has probably been asked before but after a google couldnt find the anwser. When resizing an image using the PW function: image->size() a GIF's animation is not retained (simple a GIF still), is there any way of creating computed sizes without loosing the GIF animation?
  9. Hi. I've been trying to tackle this problem all day. I have my image upload script working well. On computers, I can upload just fine and have the images resized. But when I try to upload from my phone using the camera, I see the file get uploaded to the server, but then when it comes to the resizing portion, it completely fails. No errors to trace. At first I thought it was iPhone related, but reproduced it on my Android phone. It seems to happen with camera taken images (even DSLR). I can create a photoshop image that is a larger image size, and that works. I'm able to call the image itself it and it displays the original image data, the original file is on the server, the code is pretty basic. I first try getting the URL of the first (and only) image: Start $user->avatar->first->url End Result: Start /site/assets/files/1525/profile.jpeg End BUT when I do this: Start $user->avatar->first->size(100,100)->url End I send up with: Start It simply dies with no error to trace back. Even when I have debug turned on, nothing. For the life of me, I can't seem to pinpoint the issue. Has anyone else come across this?
  10. Hey, I was wondering if there is an alternative to the default Processwire ImageSizer. Although it comes in really, really handy (I have actually never used any Content Management Framework that comes with a default Resize module) I am not quite content when it comes to resizing large images. Check this image: http://imgur.com/KNS9VWB You can clearly see a difference in sharpness of both images, after resizing the image comes out a bit blurry (Yes, quality is on 100). Has anybody else encountered this? If so, is there any good alternative (in form of a Module). Much love to anyone that's willing to help <3
  11. Right now this doesn't seem to work: $url1 = $image->size(100, 100)->url; $url2 = $image->size(100, 100, array('upscale' => false, 'cropping' => false))->url; This is because a filename like image.100x100.jpg is created for both settings. Is there a workaround for this? If not, maybe an additional MD5 hash of the settings could be added to the filename: image.100x100.d8e8fca2dc0f896fd7cb4cb0031ba249.jpg ?
  12. Hey all - I've got a new question concerning the image resize timeout discussed here: https://processwire.com/talk/topic/3718-lots-of-images-to-resize-timeout-in-frontend/ https://processwire.com/talk/topic/7744-image-width-function-timeout/ But the problem I've run into is that when the timeout occurs, it corrupts or doesn't properly build the resized images. I need a way to force the resize to run again, preferably just for the damaged/missing images. You can see an example of the missing images here: http://arthistoryproject.com/artists/ferdinand-hodler/ - scroll down in the right and check "Autumn Evening" - the image name has been created, but the file is broken Any ideas? Thanks so much!
  13. It would be great if PW would resize images using Imagemagick/graphicsmagick if one of those libs is installed as theyy provide far better quality and use less memory than GD or GD2. Just an idea.
  14. I have an issue where I want to have an image resized, but have both a cropped and non-cropped version available (of the same size!) The code to do this is simple: $imagefull = $image->size(320,320,array( 'cropping' => false); $imagecropped = $image->size(320,320,array( 'cropping' => true); However, this only creates ONE variant of the image: eg. imagename.320x320.jpg So the same image is shown twice in the output page, instead of the two options Can anyone suggest a clean way of doing this? (ie. not duplicating every base image) Is there a way of creating named Image Variations? And do these names go into the filename to guarantee uniqueness? eg. $image->addVariation($name,$size,$options) or similar Thanks
  15. Hi! I've just started developing my first PW project (it's great so far! ) and ran into an issue about how to output an thumbnail image: I want to iterate over news items which have an images repeater (field type "image", inputfield type "image") and display resized images: foreach($page->children as $news_item) { ... if (count($news_item->image_repeater)>0) { foreach ($news_item->image_repeater as $image) { <?= $image->width(250)->url; ?> <img src="<?= $image->width(250)->url; ?>" width="250" alt="" title="<?= $image->description ?>" /> } } } I get an $image returns an ID. The "image" fieldtype has the setting maximum files allowed = 1 (0 didn't work too). PW Version 2.2.13. Any idea? Thx
  16. Hello everyone, I've run into a issue with the way Processwire renames resized files in our company host provider. Basically, this pattern: myfile.0x120.png, conflicts with their security policy which they tag with the following classification: [severity "CRITICAL"] [tag "WEB_ATTACK/SQL_INJECTION"] So, somehow, when requesting a file with the pattern above, the server mistakes it for a malicious request and throws a 403 Forbidden Access. The quickest solution I've found for this was to dive into the Pageimage::size method and replace the characters used in the resized file name. Instead of using double periods in the name file, I've replaced everything with the '-' (hyphen) character and now looks like this: myfile-0-120.png. $basename .= '-' . $width . '-' . $height . "." . $this->ext(); // i.e. myfile-100-100.jpg It's not the prettiest pattern and I liked the older one better but that's secondary. The main issue here is that this change is basically an hack and feels dirty changing core methods, but it was the quickest solution I've thought of. What are your feelings on this?
  17. Hello everyone, I'm new to Process Wire and I'm trying to set up a website for a magazine. My first task was to import a bunch of videos from another site into PW and it actually worked out quite good. Now I've got a bunch of pages with an external image reference in the image field. My idea was *not* to copy the whole lot of images, but to download and resize the ones that are requested. The first naiive attempt was this: <img src="<?=$article->video_image->size(350,88)->url; ?>"> With 'video_image' being a full path to an image on another remote server. Soo ... that didn't work. Do I need to copy the image to my server before resizing it? Or is there a trick to resize it and save only the "new" image on my server? Thanks for any help! Loving PW so far! thomas
×
×
  • Create New...