Search the Community
Showing results for tags 'images'.
-
What are your experiences with profile/color consistency when using Image Magick for resizing? I know @horst is probably the person with the most experience on this, (hope you can chime in here Horst) Problem: I noticed that In some cases Image Magic resized jpgs appear darker than the original, and after some digging it appears to involve various factors concering both the image preparation (Photoshop's save for web and even general profile handling before that) and the way the Image Magic resizing process is setup. - Images with an embedded (srgb) profile that were exported via Photoshop's "save for web" function with "convert to srgb" and "embed profile" ON, somehow result in muted colors and a darker image, (actually it looks very much like when you would assign an srgb profile to an image that was already converted to srgb before, not dramatic, but quite noticeable with e.g. reds and cyans.) - I tried multiple variations, with embedded and excluded srgb profile, "convert to srgb" on and off, but the result appears to be the same darker, muted image. Need to find time to do more structured testing though.. Possible causes: - The way the srgb profile is embedded in the jpg - The way the Imagick module detects/ignores profiles - Colorspace handling changes between imagick versions - One of the above plus these rather involved technical reccomendations (tldr: convert to linear RGB, resize, convert back) http://www.4p8.com/eric.brasseur/gamma.html#ImageMagick http://www.imagemagick.org/Usage/resize/#resize_colorspace Would be nice to get a discussion going here. I am out of my league with this, technical knowledge wise but I'll try to keep up Cheers guys, Phil
-
Hey! I am working on a module that imports some images. But I have some struggles with a check. I need a check because if I hit the import button twice, I have the images double. I have the following code: protected function importImages() { $languages = wire("languages"); $images = $this->get_images(); $images->execute(array(':iso' => 'en')); $pictures = $images->fetchAll(PDO::FETCH_ASSOC); foreach ($pictures as $picture) { $id_product = $picture['id_product']; $product_page = $this->pages->get("productid=$id_product"); // ensure output formatting is off $product_page->of(false); $str_prlink = $picture['product_name']; //make sure end of string ends with alphanumeric $image_name = preg_replace('/[^a-z0-9]+\Z/i', '', $str_prlink); //echo $picture['id_product'] . '-' . $image_name . '-' . $picture['ean13'] . '.html'; $image_url = $picture['file_id'] . "/" . $image_name . '.jpg'; //echo "<br />"; $image_path = "http://www.r-go-tools.com/" . $image_url; //echo "file id:". $file; try { $product_page->images_product->add($image_path); } catch (Exception $e) { } // $product_page->of(false); $product_page->save(); } } I want to delete the images that are currently in that field, and then import the new images. How can I fix this?
-
Hi all, I'm trying to upload an image to a blog post. The ProcessWire blog editing page is relatively simple. See attached. When I try to add more images and publish the post an internal server error is returned and a blank space is where the additional images should be. Can anyone advise on how this can be resolved quickly. Please let me know any additional information you'd need. Many thanks. JMH
-
I have been plagued by this issue since day one. I cannot access or use any image I have uploaded. I can see them in the directory on the server and when I click on an image I can see a preview in the editor but as the video Video in my dropbox shows it doesn't provide me with a way to utilize those images. I can't see anything obvious. I did upgrade to 3.0.34 and have left the site pretty bare bones until this issue is resolved. Thanks in advance! processwire-images-bug.mp4
- 8 replies
-
- thumbnails
- media
-
(and 1 more)
Tagged with:
-
One of PW 3.010's major novelty was the introduction of Horst's new image resizing engine that uses ImageMagick. Now I understand that ImageMagick can convert images to Webp, the image format that Google says can reduce image size up to 34% compared to JPEG. Mozilla is apparently adding support to Firefox, and even the Safari team is playing with it, so it looks like Webp is soon going to be available in most major browsers. If Horst's module can be extended to add Webp conversion, that would be a great addition to PW's already very powerful image manipulation arsenal. I'm currently using the free ImageEngine Lite to serve Webp images to supporting browsers, and the results are impressive. I routinely get images that are between 25 and 60% smaller compared to JPEG, with the same visual quality. I would love to eliminate the need to rely on a third-party service though.
-
Hi I have an image field in the back end, that expects multiple images. Now I've added this hook as the files are added: $page->addHookAfter('InputfieldFile::fileAdded', function($event) { $inputfield = $event->object; wire('log')->save('image-resizing', "Resizing "); $image = $event->argumentsByName("pagefile"); $image->size(800,0,array('upscaling' => false)); $image->size(300,200,array('cropping' => true, 'quality' => 80 )); }); It works absolutely fine for a small amount of images, but uploading a large amount doesn't seem to work. No errors are logged either. Now all thes photos appear to have uploaded in the back end, and show the thumbnails, but upon clicking save images are missing. I've checked all my php settings and ensured they are all adequate enough. memory_limit 512mb upload_max_filesize 200mb max_execution_time 300 If I disable this hook, I can upload all images fine. Please could anyone other any insight into what may be causing this issue? Thanks in advance
-
Hello! I just found processwire yesterday (actually i heard about it before, but never looked into it) and installed it to play around. I'm really impressed, as a guy who only used wordpress i like it very much and i tried to replicate one of my sites in processwire and so far it seems doable, the taxonomies will be a little tricky i think. Now to the main point, i've read a blog post here giving some tips, one tip was to use only one image field and to group images by tags. The problem: there doesn't seem to be a way to add a tag to multiple images at once, making the process inconvenient. Would it be possible to add a prompt for defining a tag before selecting the images and the uploaded images will have that tag.
-
Hi everyone, I am new to Processwire and am hoping that you will be able to help me out. I have currently taken over a website from one of my colleagues and have been asked to implement a gallery. I have created the appropriate fields and code but have come across an issue when trying to upload images to the field. Initially I uploaded multiple images of varying sizes and I found that the loading bar reaches the end very quickly then the loading icon/graphic just continues to spin, I waited for an hour or so for them to load but it never did, it just kept spinning. I then reloaded the page and the images were not shown in the field. I decided to then upload one small image (roughly 200KB) and again it did the same as above. I left the site 24 hours to see if it would fix itself. However when that time had passed and I tried again it failed again. I asked my colleague if he had any issues with uploading images but apparently it was fine when he was using it. Does anyone know what is causing this and if there is a fix? See attached image. Thanks, Matt
-
Hey, I'm pulling my hair out abit with CKeditor settings (documentation is impregnable), I'm trying to set the default width x height in the image modal to the same as the original image by default, not some random number which it seems to be currently. is this possible?
-
Hi there, I noticed, that one can easily import images from other pages into a textarea field in the backend, while the images field only allows for upload from the local machine. Correct me if i am wrong. Is there a possibility to copy images from another page, e.g. a special image repository page, into an image - type field from the backend, for the average page editor? Thanks for your thoughts.
-
Hi there, in an image gallery with the following code foreach ($page->bilder as $bild) { $thumbnail = $bild->size($page->thumbnail_size,$page->thumbnail_size); ... a JS gallery function broke down with the error message: "unitegallery.min.js:6 Uncaught Error: Can't get image size - image not inited." I looked into the /assets/files/nnnn/ folder and found 5 images (of about 16 or so) having api - generated version with only 42 Bytes. 4 of them had the string "....0x0.jpg" in their filename, but the 5th had an unsuspicious filename. They were all generated within the same second, according to their timestamp. In the backend, they could neither be opened nor deleted. Via FTP they could be deleted. This fixed the problem with the gallery. In the /logs/exceptions.txt I found lines like leute_im_boot.0x0.jpg - not a recognized image (in /wire/core/ImageSizer.php line 257) In the errors log I did not find anything apparently related. Did anybody observe something similar? cheers - - -
-
Hey, I would like to add tags to an image field upload via api. Does anybody have some information on that? im using the following code to update images on a page. # remove images if(count($page->images)) { $page->images->deleteAll(); $page->save(); } # upload images foreach($product->image as $image) { $page->images->add($image->url); $page->images->tags = ? // not working } $page->save(); During Page Update the backend says: Session: Item 'tags' set to ProcessWire\Pageimages is not an allowed type Thanks for help.
-
I have a template that includes an image field that supports multiple images. The images uploaded to this field include a description field. If one of these images is embedded into a textarea field (i.e. Body), should the image description will be inserted into the image's alt attribute when embedding the image? I always assumed that it would, but there is a separate option to add an alt attribute when inserting the image. Is the purpose of the description field purely for use with the API and unnecessary for images that are intended to be embedded within a textarea field? I guess I need clarification as to how this works. Either something changed, or I never understood the differences between the image description and the alt attribute as it is used in ProcessWire. I'm currently using ProcessWire 3.0.15.
- 10 replies
-
Hi there, I'm using ImageSizerEngineIMagic and it has an overridable, default image quality value. In my application code, you can override the module's value based on a user Page field value. However, if there is no "custom" value in the page field, I'd like to be able to access the ImageSizerEngineIMagic module's default value. There is likely a very easy way to do this. If anyone could point me to it, I'd be very grateful! Many thanks.
-
Hello all I have successfully displayed an array of images using the following code. if (count($page->images)) { $images = ''; foreach($page->images as $image) { $image = $image->size(800); $images .= "<img src='{$image->url}' /><br />"; } } However, occasionally this template calls an image that is smaller than 800 pixels wide, and when these images are forced to display larger than their original size, they are pixellated (see example here). I would like to edit the above code to make it do the following: check the size of each image if the image is >800px wide, display as 800px wide if the image is <801px wide, display at original size My best guess is this: if (count($page->images)) { $images = ''; foreach($page->images as $image) { if {$page->image->height(<801); $image = $image->size()} else {$image = $image->size(800)}; $images .= "<img src='{$image->url}' /><br />"; } } But I have a poor understanding of loops. My question is: Can someone suggest a fix for my second code example to make it work? Please note my templates are written in object oriented php, so solutions using 'echo' will not work in my use case. Thanks for reading!
-
I am trying to add images to a page from the basic $images default field. I have followed the instructions here: https://processwire.com/docs/tutorials-old/quick-start/images/ And the code of my template looks like this: <?php // assignment_studentwork_example.php template file $assignment_w_heading = "<h1><strong>Assignment:</strong> <a href='{$page->parent->url}'>" . $page->parent->title . "</a></h1>" ; $semester = "<p><strong>Semester:</strong> <a href='{$page->parent->url}'>" . $page->parent("template=challenge") . "</a></p>" ; if (count($page->images)) { foreach($page->images as $image) { $image = $image->size(800); echo "<img src='{$image->url}' />"; } } // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if($page->hasChildren) $content .= renderNav($page->children, 0, 'summary'); // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if($page->rootParent->hasChildren > 1) { $sidebar = renderNav($page->rootParent, 3) . $page->sidebar; } // Primary content goes here $content = $assignment_w_heading . $semester . $image . $page->body; This code successfully loaded the images, but they load at the top of my site, above all content, like this: The generated html positions the images immediately after the body tag, instead of between $semester and $page->body: I think this is because of the kind of php structure I've written my templates in (object oriented?). I remember I have had to use workarounds instead of 'echo' in the past in my templates, but I don't remember why. I only have basic php coding skills. I have tried to reposition the images by adding a class and styling it with css, but no luck. I think this is because of where the images are positioned within the generated html, as I want the images to be positioned in css 'relative' to the elements above them in my php code, but the generated html positions the images out of order. My questions are: 1. is there an alternative way to call images that removes the need to use 'echo'? 2. can anyone see a way to fix my code so that the images will appear where the text 'business-card-putney-daniel2.800x0.png' appears, instead of at the top of the page? It would also be good to remove the text 'business-card-putney-daniel2.800x0.png' at some point - I don't see what is generating it, but right now it serves as a handy placeholder for where the images should go. Thanks for reading, and I hope you can help!
-
Hello again, while I evaluated possabilities around reusing the image dialog outside of CKE (https://processwire.com/talk/topic/10009-image-field-select-image-from-another-page/) I did a introspektion of CKE's pwimage plugin (indeed I reused a lot of the given logic). Because I don't like the way, the plugin grabs its image information in a big bulk of code, I started to refactor the code and ended in something like this (excerpt): [..] this.config = { uri : ProcessWire.config.urls.admin + 'page/image/' , selectors : { image : '#selected_image' , captionWrapper : '#wrap_caption' , cbLink : '#selected_image_link' , cbHiDpi : '#selected_image_hidpi' , cbCaption : '#selected_image_caption' , inDescription : '#selected_image_description' , inRotation : '#selected_image_rotate' , inPageId : '#page_id' } [..] }; [..] , getImageProperties : function (jImage , jIframeContent) { var that = this; var jImage = jQuery (that.config.selectors.image , jIframeContent); var jCheckboxLinkToLarger = jQuery (that.config.selectors.cbLink , jIframeContent); var jCheckboxHiDpi = jQuery (that.config.selectors.cbHiDpi , jIframeContent); var jCheckboxCaption = jQuery (that.config.selectors.cbCaption , jIframeContent); var jInputDescription = jQuery (that.config.selectors.inDescription , jIframeContent); var jInputRotation = jQuery (that.config.selectors.inRotation , jIframeContent); var jInputPageId = jQuery (that.config.selectors.inPageId , jIframeContent); var flipHorizontal = jImage.hasClass ('flip_horizontal'); var flipVertical = jImage.hasClass ('flip_vertical'); var src = jImage.attr ('src'); var cls = jImage .removeClass ('ui-resizable No Alignment resizable_setup') .removeClass ('rotate90 rotate180 rotate270 rotate-90 rotate-180 rotate-270') .removeClass ('flip_vertical flip_horizontal') .attr ('class') ; var imageProperties = { 'identifier' : jImage.data ('idname') , 'pageId' : jInputPageId.val () , 'src' : src , 'file' : src.substring (src.lastIndexOf ('/') + 1) , 'origin' : jCheckboxLinkToLarger.val () , 'width' : jImage.attr ('width') , 'height' : jImage.attr ('height') , 'widthAuto' : jImage.attr ('width') == 0 , 'linkOrigin' : jCheckboxLinkToLarger.is (":checked") , 'alt' : jInputDescription.val () , 'caption' : jCheckboxCaption.is (":checked") , 'hidpi' : jCheckboxHiDpi.is (":checked") , 'editing' : { 'rotate' : parseInt (jInputRotation.val ()) , 'flip-h' : flipHorizontal , 'flip-v' : flipVertical , 'crop-x' : 0 , 'crop-y' : 0 } , 'class' : cls }; if (! imageProperties.width) { imageProperties.width = jImage.width (); } if (! imageProperties.height) { imageProperties.height = jImage.height (); } return imageProperties; } As you can see, I started to put selectors into configurations und tried to build a literal of the significant image data (which was the goal). I thought it would be nice, if the Image modal page itself could implement an interface like this. So that every derived operation (including CKE) could simply ask for image properties instead of scratching data from markup and input element status all by itself. In result there would exist a future proof approach for times when UI elements, possible image modifications etc. change.
-
Hi, i don't understand why this problem only appears when im trying to edit the root page (home). All subpages are working. I made a video of the problem: Video My boss made an update yesterday from php version 5.3.29 to 5.6.17-1~he.2 (At the moment i am not able to downgrade the version) Maybe this is the reason? My Processwire Version: 2.7.2 MySQL-Version (PHPMYADMIN) MySQL-Version (phpinfo();)
- 12 replies
-
Maybe I have messed up somewhere here (As it is working on my local server), but an image used as the header on the live branch has just suddenly "disappeared". I imported all of my fields from my local branch (which included the pageHeader image field), and loaded in my content just fine. Yesterday I was just going through a few of the demo pages and the header image is no longer displaying on site. I looked at the page itself on the backend and the image is displaying there, just not in the front end. Is it possible for the data to corrupt over a few weeks? If you look at the screenshot, it looks like the code isnt even pulling in the image to the src.
- 1 reply
-
- image field
- images
-
(and 1 more)
Tagged with:
-
Hi guys Trying to output a series of image tags in surrounded by an <li> a I've been partially successful in that the tags are displaying BUT they're repeating. IE the following code ... will output Sitting-Room Kitchen Kitchen Home-Office Gym Basement Bedroom Gym Basement There's repetition in there. I only need a tag listed once. There's also a case where an image has 3 tags IE Bedroom Gym Basementis actually 3 separate tags. That's the first 2 parts of my problem
-
On my dev (localhost) my gallery appears to be working just fine. It is set to "Automatic", and if I drop in 8 images all of them upload in the order I selected and all save out. However on my production server, the images upload all out of order and then it deletes 4 of them. Has anyone else had this issue or know how to solve it?
-
I don't have screengrabs right now but I was uploading several staff photos this evening. Has anyone experienced an issue whereby uploaded (drag and drop) images become desaturated slightly? It's quite subtle but noticeable enough when viewed side by side with original image.
-
I'm creating a general function for batch import, for a site migration, and while looping through fields (field names) to be imported for a page, I need to check whether the field is an image (or other file type), so that it can be imported after the first pave save. What would be the recommended way to check this, with PHP code?
-
I need to extend the search capability to image descriptions through the default search template in 2.5.3. $matches = $pages->find("title|body|sidebar|thumb_one|thumb_two|thumb_three|thumb_four|gallery_img%=$q, limit=50"); I've added additional field selectors, but with inconsistent results. Is there a better way to achieve this?