how can nightmare upload a image file? - nightmare

Well.I use nightmare to do some test taskes.It's so good for basing on electron and phatomjs.
Now, I have a question about how can I upload a image file through nightmare?
Well.I find a plugin named night-upload. After it upload a image file successfully, the page become white and has nothing to show.
So.Is there some solutions to solve this problem?

Well. The plugin of night-upload can upload a image file through nightmare.
I had write relative path of image file before. So it has the problem as I said: the browser of electron will become white and show nothing, the main process has hang up. Now I change the image file to absolute path. It works!

Related

Displaying both PNG and JPEG files in React

I think this is a repeat question but I can't seem to find the right answer...
I can upload png and jpeg images just fine (mern with multer) however when it comes to displaying the PNG file I have some issues.
File location is in the public/uploads folder
Successful display of JPEG (Displays JPEG correctly with the following) but fails on PNG
<img src={`${post.image}`} alt="testing"></img>
Error when it comes to PNG (404 Not Found)
GET http://localhost:3000/uploads/postImage-1637006445002-134875838-Screen%20Shot%202021-11-15%20at%205.25.09%20PM.png 404 (Not Found)
If I try the following, I get another kind of error for both JPEG and PNG
<img src={require(post.image).default} alt="testing"></img>
Cannot find module '/uploads/postImage-1637006445002-134875838-Screen Shot 2021-11-15 at 5.25.09 PM.png'
Doing an import such as below doesn't really make sense since I'm pulling the image name from a database and then referencing it's location in the public/uploads folder
import Image from 'uploads/fileName.png';
My other option is to a fileFilter on the backend and limit uploads to just JPEG but that seems limiting.
The only difference between the two that I can tell is the file type. Backend file handling is the exact same, so my question is how do I display PNG images the same exact way that I display JPEG's? Is there some config with React that I have to change?
Any help would be much appreciated. Thank you,
Your web server may be setup to receive the PNG mime type, but not to send files of this type, which would account for the 404 error you are receiving when you try to render it. Each web server is different in how this is configured.
I didn't know that spaces in the file name when uploading wouldn't get pulled properly by React. If you're running into this, what fixed my issue was removing spaces from the filename. Thanks to Steve -Cutter- Blades for pointing it out.

Add Image over another image and save it

I am working on a react project in which we generate new images by fitting uploaded image in a tv screen, or laptop screen or mobile screen. So what I want is a way in which I can place the uploaded image into this below image
In the black tv screen I want the uploaded image to fit and below there will be download option to download the uploaded image.
I searched for that and came across cloudinary react library. So I wrote this code to somehow fit an image inside this image but I can't seem to find any way to download that image.
If you have any idea of doing this please share with me.
Thank You in advance
You can overlay images on other images without having to use a particular Cloudinary SDK, as outlined here: https://cloudinary.com/documentation/image_transformations#adding_image_overlays
You can then place them more specifically using x and y coordinates in the URL as outlined here: https://cloudinary.com/documentation/image_transformations#placing_overlays
Once you have generated an image with the overlay positioned correctly (and with any other transformations you may wish to process), you can download the generated image as normal.

Adding local image in Jupyter SQL notebook

Started using Azure data studio and creating documentation for some SQL processes in our system.
As part of that I need to include a flow diagram in the document. Currently I have uploaded an image to a URL and am able to embed the image in document from the URL.
But is there any way to include an image from a local folder? Please assist.
I think this is what you want.
from IPython.display import Image
Image(filename='C:/your_path/your_image.PNG',width=200, height=100)
I was interested in this also. Syntax should be (if you store images in subfolder relative to notebook):
![ssms_subquery](images/16_ssms_subquery.png)
This didn't work for me initially: rendered as a broken image icon.
Things I tried:
Make sure you have a workspace defined for your root folder. Create the folder, then select "File > Add Folder to Workspace ..."
If that does nothing, try closing and restarting ADS. I've found the rendering to be flaky from time to time after awhile or if you have been opening/closing notebooks a lot.
Related topic has been discussed previously for markdown in general (but worth asking again for ADS!), eg. How to display local image in markdown

Why can't I view these images in my cpanel?(not a caching issue)

So Im fixing the gallery page on this website https://gilbertmovingandstorage.com/gallery.html as you can see certain images aren't loading? I uploaded them in the img folder on the cpanel. I can see them right next to those images that are visible in the gallery? The img src has no typos and its not a caching issue because I can't see these images in incognito either? Please someone help me I'm sick of all these issues! This project is taking me too long
here's proof that the images are in the folder https://imgur.com/a/dkfqYq5
and here's a pic of two images and there src url. One can be viewed on the site and the other one can't? Even though there's no typo https://imgur.com/a/GmdPP0z
Also looking at the source in the devtools then opening the img folder then the gallery_img folder I don't see the images there? I only see the ones that are visible on the site? So does that mean iit is a caching issue, and if it is why then can't I see it in incognito or when I clear the cache??
I just loaded the URL and all the images loaded correctly for me.

Problem publishing images in Silverlight PivotViewer

I'm working on a Silverlight PivotViewer app and using the Excel Pivot Collection tool to generate my image files. Everything works perfectly except some images are not being published by the tool. As a result, when the app launches, everything looks great except there are blank spaces where the unpublished images are supposed to be. All of their data/facets are available if I click on a "blank" image.
When I dig a little deeper and look at the files that are generated, the missing images are not there. What's more interesting, if I look a the cxml file. The images information is all there only the missing images are missing their "img" attribute. For some reason, the Pivot Collection tool recognizes that there are images but chooses not to publish them. I've tried re-creating the images as both PNGs and JPGs to no success.
Does anyone know why this is happening and how I can fix it?
Delete the entire collection_files folder and the cxml file. Republish the images and then add the newly published collection_files folder and cxml file to your project.

Resources