If I compress and save an image as WebP and then rename the extension as jpg will there be any downsides? This is why I ask:
My blog doesn't support WebP format, however if I rename it to png or jpg it will accept it.
What's the possible downsides on this trick?
As of December 2020, all major browsers support JPEG, but not all fully support WebP [https://caniuse.com/webp]. Users of browsers without WebP support won't see the images when visiting the page, so this might be why your blog platform doesn't accept WebP files.
Another downside: if someone downloads an image, the downloaded file will still have the ".jpg" extension despite being WebP format. Many programs depend on file extensions to know how to open it. They will try to decode it as JPEG, but fail, since the file is WebP.
I just change the name from .webp to .jpg and I have never had a problem. Obviously, you have to set your file manager (File Explorer) to be able to view the file name extensions.
Related
I am using prawn to generate pdf files which have lots of images so they come out quite large. I can open the file in Adobe Acrobat and then save it using the "reduce file size" option, and a 164MB file shrunk to 7MB and retained all of the image quality. I would like to replicate this compression in Ruby. I have tried using the compression settings which prawn offers and they have not had any effect on the file size. I suspect there must be a way to do it with RMagick, but I haven't figured it out yet.
I apologize for not including any code samples showing what I have tried, but I removed the prawn compression settings when they didn't have any effect, so I don't have anything to show.
Have you tried simply making a copy of the PDF with RMagick? That is, read in the PDF and write it back out again.
Also, check with the ImageMagick folks at https://www.imagemagick.org/discourse-server/. Any advice they offer you can be implemented via RMagick.
I'm wondering how it possible to extract images from .swf viewer?
Note that .swf file have not images itself.
For example I'm trying extract images from AVON catalogue from this link - http://avon.com.ua/PRSuite/eBrochure.page?index=1&cmpgnYrNr=201404&pageNo=0
Any ideas?
Best way is to put the .swf file in a decompiler for image extraction. Decompilers are smart enough to extract images for you and arrange them.
JPEXS Free Flash Decompiler is a more popular one
http://www.free-decompiler.com/flash/
You can extract other useful content from it as well.
Just download the .swf file from the website
A while back (like around 1999) I wrote a set of tools for Flash animations.
One of the tools is swf_dump which can be used to extract objects (i.e. write the objects in a form of script that sswf can nearly recompile...)
The tool also allows for extracting images that are inline (not downloaded dynamically by the flash animation, if so, anyway, you could as well download those images manually, you'd need the URL, though.)
The command line you can use is:
swf_dump -d my-animation.swf
Then your current folder will be littered with all the images that were found in the flash file. It extracts JPEGs and PNGs. The source can be compressed (SWF or CWF are supported.)
Now, you're on your own to compile that thing... The project is here and is in great need of updating (but Flash is kind of going out too...)
https://sourceforge.net/projects/sswf/
I'm working with an existing ActiveX control, we have a NPAPI for it, and it works well for the most part in FireFox.
It supports viewing image types, one type, TIFF works well but for some reason JPG doesn't.
So I simplified MIMEType in my .rc file to be simply "image/tiff". That works well, I can drag a *.tif file into FireFox and the plugin loads.
However when I my MIMEType is defined as simply "image/jpeg", it doesn't work for *.jpg files and FF just natively displays the JPG instead of letting my plugin do it. I tried "image/jpe" and that works for *.jpe files. I also tried "image/jpg", but no luck. Is JPG a special case for NPAPI?
Additionally, I can get my plugin to load for *.jp2 files when I specify "image/jp2". I don't seem to have any other plugin installed that would be loading the JPG instead. In fact, plugin-container.exe doesn't even load when FireFox displays the JPG so that makes me think it has something to do with FF's native display overriding my plugin.
For supported (built-in) image types, plugins are not considered (i don't think any browser does that).
TIFF is not a supported image type for Firefox, hence plugins are used if they handle that mimetype/extension.
Note: When handling image mimetypes you are prone to colliding with other plugins (Quicktime specifically) - there are no real guarantees on which plugin will be used if more than one supports a specific mimetype or extension.
It wouldn't surprise me at all if Firefox is overriding your plugin; the last thing they want is for a plugin to be able to take over viewing basic filetypes. I'm kinda surprised overriding tiff worked, to be honest.
my app's resources are png format,but when I run the app,and open the sandbox's content resources directory,I found that all the images in png format are changed to tiff format,how is it going?
anyone could help me?
Thanks!
This sounds like you have the "Combine High Resolution Artwork" setting set in your project's build settings. With this option set Xcode will automatically combine a standard and #2x image into a single TIFF. See this Apple doc for details.
Would anyone have any pointers on getting PNG images to display in Emacs 23 under Win32?.. I have installed the gnuwin32 set of utilities, including libpng and zlib; C:\Program Files\GnuWin32\bin is in path. JPG files started working but not PNGs. I'd appreciate any hints on getting this to work.
EDIT: PNG thumbnails actually display fine (e.g. in dired via C-t C-t). However, opening them fails (opens as garbage in fundamental mode, and M-x image-mode says "invalid image specification").
You have to copy one of these dlls "libpng12d.dll" "libpng12.dll" "libpng.dll" "libpng13d.dll" "libpng13.dll" to your emacs-23.1/bin/ directory. They require zlib1.dll which you have to copy as well. I did the same thing for jpeg62.dll and giflib4.dll and now my emacs supports jpg, gif and png files. For some reason it does not work if I simply put these dlls in the path.
You can check (image-type-available-p 'png) to see if png is supported. image-library-alist maps image type to a list of dlls which support it.
According to the official manual:
3.3 How do I get image support?
Emacs has built in support for XBM and PBM/PGM/PPM images. This is sufficient to see the monochrome splash screen and tool-bar icons. Since 22.2, the official precompiled binaries for Windows have bundled libXpm, which is required to display the color versions of those images.
Emacs is compiled to recognize JPEG, PNG, GIF and TIFF images also, but displaying these image types require external DLLs which are not bundled with Emacs. See Other useful ports.
Those dlls for the various image formats are (as far as I know) - XPM (xpm4.dll), PNG (libpng13.dll, zlib1.dll), JPEG (jpeg62.dll), TIFF (libtiff3.dll) and GIF (giflib4.dll);
Starting with Emacs 25 the Emacs Windows download directory includes -deps zip packages, that can be extracted to your emacs installation folder and include image libraries for PNG, SVG, JPEG, GIF, TIFF and more.
See also this emacs.stackexchange answer.
To display which version of the PNG dll your Emacs for Windows version requires, you can evaluate (cdr (assq 'png dynamic-library-alist))