why vue-range-component is not working fine in sweet-modal Vuejs - rangeslider

I am trying to get Vue-range-component functionality in my project, but it was not loading perfectly on the sweet-modal.
please check image how range showing
<vue-range-slider
v-model="value1"
:min="min1"
:max="max1"
>
</vue-range-slider>
import VueRangeSlider from 'vue-range-component'

Related

Convert images to Icons is giving errors

I'm converting images to icons using this code:
import PIL.image
img = PIL.Image.open ("imagepath.png")
img.save ("iconpath.ico")
This is giving me an icon file as desired, but when I try to open it an error pops up:
Paint:
Microsoft photos error:
When I try to open other icons with the same programs they work perfectly, but it doesn't with the ones I made. Does anyone know any other way or library for doing this?
Try this:
img.save('iconpath.ico',format = 'ICO', sizes=[(32,32)])
You can change size to 16,16
First time I was converting image with PIL I've used this tutorial:
Tutorial
Everything worked fine.
The image that is being converted has to have a 1:1 proportion, if not, when trying to open the generated icon it will cause errors.

Pycharm error in one project and not the other

I am running PyCharm Community Edition 2021.1.3 and having this strange problem where I would run a file in one project and it would produce an error but run the same file in another project and it would produce no error. I have tried figuring out what is causing the problem but to no avail. I have discovered that any file with an import, in the first project (The one that gives me an error) would always get the error but a file without any imports works fine. This is the same whether the code after is correct or not. If someone could please help me with this problem as I could have missed something simple it would be much appreciated.
Code used in both projects:
from flask import Flask, render_template
from forms import RecommendationForm
app = Flask(__name__)
app.config['SECRET_KEY'] = '777'
#app.route('/')
def home():
form = RecommendationForm()
return render_template('index.html', form=form)
if __name__ == '__main__':
app.run()
Screenshot of project producing error:
Pycharm project with error
Screenshot of project working correctly:
Diffrent Pycharm project with the same code
The error tends to generally look the same with a few variations. Here is an example running different code but in the first project.
Diffrent code run in the error producing project
The rest of the error logs from the above example

PDFBox - java.lang.UnsatisfiedLinkError: jpeg (Library is already loaded in another ClassLoader)

I just integrated PDFBox into my project in order to generate image from a PDF page.
I made a unit test generating such image.
It works well in my dev environment.
However, when running the test in our gitlab, it is not able to load properly:
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:1461)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:1408)
at java.lang.System.loadLibrary(System.java:583)
at com.sun.imageio.plugins.jpeg.JPEGImageReader$1.run(JPEGImageReader.java:104)
at com.sun.imageio.plugins.jpeg.JPEGImageReader$1.run(JPEGImageReader.java:102)
at java.security.AccessController.doPrivileged(AccessController.java:678)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.<clinit>(JPEGImageReader.java:101)
at com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:97)
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:331)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:540)
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:524)
at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:155)
at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:58)
at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:80)
at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:179)
at org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:241)
at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.createInputStream(PDImageXObject.java:793)
at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:517)
at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:226)
at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:479)
at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:460)
at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:1059)
at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:67)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:933)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:515)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:489)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:156)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:275)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:347)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:268)
at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:240)
Anyone got an idea ?
Thanks !

Import logo from '../../img/logo.png - Can not find module

I am creating a REACT NODEJS Application using Create-React-App
I'm copying from a premade REACT site which imports images like this:
import Logo from '../../img/logo.png'
but when I do the same in my application, I get the error
Can not find module
My Folder stucture is:
\src\views\home\layout\layout.tsx \\this is the problem file
\src\views\img\logo.png \\this definitely exists
When I use require directly in my JSX it works fine, however I don't want to start off on the wrong foot doing things differently
<img src={require("../../img/logo.png")} alt="" /></a> //Works
From your folder structure your import statement should look like
import Logo from '../../../imgs/logo.png'
Edited and corrected after #zerkms pointed out my folly of counting one extra folder in the path.

How to import an existing PDF file in node.js

I am working on import routines for node, so far I can import text nodes from a PDF using pdf2json, this works well, but doesn't work on PDF's that are image based and contain no text.
So I downloaded pdf2img, however there are plenty of issues with this module, the one I have now is that after running it, I get a lot of 0 byte png files created, no content and an error message:
/docfire/node_modules/gm/lib/command.js:228
proc.stdin.once('error', cb);
^
TypeError: Cannot read property 'once' of undefined
at gm._spawn (/docfire/node_modules/gm/lib/command.js:228:15)
at /docfire/node_modules/gm/lib/command.js:140:19
at series (/docfire/node_modules/array-series/index.js:11:36)
at gm._preprocess
(/docfire/node_modules/gm/lib/command.js:177:5)
at gm.stream (/docfire/node_modules/gm/lib/command.js:138:10)
at convertPdf2Img (/docfire/node_modules/pdf2img/lib/pdf2img.js:93:6)
at /docfire/node_modules/pdf2img/lib/pdf2img.js:67:9
at /docfire/node_modules/async/lib/async.js:246:17
at /docfire/node_modules/async/lib/async.js:122:13
at _each (/docfire/node_modules/async/lib/async.js:46:13)
I've tried posting a issue on the GIT site for the module, but it looks like quite a few people are having exactly the same problem and there doesn't seem to be any activity regarding any fixes.
What I would ideally like is a way to extract text and images from a PDF for node.
I'm running on an iMAC running macOS Sierra v10.12.4
With node version 7.8.0, pdf2img 0.2.0, gm 1.23.0
You can try pdf-image npm package.
https://www.npmjs.com/package/pdf-image
Hope this helps.

Resources