Imageresizer.net showing red dot in free version - imageresizer

I recently updated ImageResizer.NET to version 4.04 and a small red dot is now appearing on all the resized images. I understand this occurs if you don't have a paid for license but haven't entered the license key in the web.config. However, I am using the free version with no paid for plugins. According to the website, no license is required for the free version.
I have restarted the website and viewed different images so I don't think it's caching them.
Here is the output from resizer.debug:
Image resizer diagnostic sheet 1/25/2016 10:52:33 AM
0 Issues detected:
Assembly use report:
You do not seem to be using any plugins from (commerical/AGPL) editions.
Registered plugins:
ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.WebConfigLicenseReader
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.Basic.MvcRoutingShimPlugin
ImageResizer.Plugins.Basic.DefaultSettings
ImageResizer.Plugins.TinyCache.TinyCachePlugin
Configuration:
<resizer>
<plugins>
<add name="DefaultSettings" />
<add name="TinyCache" />
</plugins>
<defaultsettings explicitSizeScaleMode="Both" />
<clientcache minutes="1440" />
</resizer>
Accepted querystring keys:
quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, crop, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, frame, useresizingpipeline, cache, process, margin, dpi, zoom, autorotate,
Accepted file extensions:
bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi,
How do I get rid of this red dot?

If you add &crop=10,10,-10,10, does the dot disappear?
If so, you've saved watermarked images to disk as originals. Perhaps you're using ImageResizer during upload or the storage process, and have unlicensed plugins for a different instance of ImageResizer.Configuration.Config? You can access the diagnostics page string from code - GetDiagnosticsPage() or write it to a file - WriteDiagnosticsTo(string path) to assist with troubleshooting.
The code which creates the red dot registers itself as a plugin, LicenseEnforcer. That plugin is not present in the diagnostics page, which tells me that the application process serving you the diagnostics page is likely different from the one serving your images. That, or you are using a custom Config instance at runtime.

Related

where to put my icon picture for expo to use instead of default one?

according to expo documentation:
The most straightforward way to provide an icon for your app is to provide the icon key in app.json
so I added my own icon to the assets folder where expo's default icons are, and modified app.json to point to my icon:
"expo": {
...
"icon": "./assets/myIcon.png"
}
but when launching I get this error from expo:
Field: icon - cannot access file at './assets/myIcon.png
what am I missing? where should I put my Icon picture?
Solved
by running expo start -c to clear cache.
*Note: it took me a few minutes to sync with my expo client app!
Based on the conversation that I had with the question poster (#Blue Turtle) there are some take aways from this.
Image sizes
It is important to make sure that the image that you are using for your icon must be a perfect square. If it is not Expo will give an error similar to below
Error: Problems validating asset fields in app.json. See https://docs.expo.io/
• Field: icon - image should be square, but the file at './assets/icon.png' has dimensions 1242x2436.
The documents recommend that you use an image that has size 1024x1024 https://docs.expo.io/versions/latest/workflow/configuration/#icon
Local path or remote url to an image to use for your app's icon. We
recommend that you use a 1024x1024 png file. This icon will appear on
the home screen and within the Expo app.
Clearing the cache
Also when updating assets etc, it is advisable to close and restart your bundler, restarting using the following command expo start -c. Starting the bundler this way will ensure that your cache is cleared and that any changes that you have made to packages, assets etc will be made and you will hopefully experience less errors.

How to upload mp4 video in wysiwyg editor in magento

<adminhtml>
<cms>
<browser>
<extensions>
<allowed>
<mp4>1</mp4>
</allowed>
</extensions>
</browser>
</cms>
</adminhtml>
after I add this to my config.xml
I upload an mp4 file, but a warning of unsupported format of image shows up.
First thing, I recommend creating a local module to avoid to modify core files. Then, override the following Magento classes:
Mage_Core_Model_File_Validator_Image
Mage_Cms_Model_Wysiwyg_Images_Storage
Changing the validate function comparing with the video/mp4 filetype: mime_content_type($filePath) == 'video/mp4'
Adds the mp4 extension to the array of allowed and image_allowed from your config.xml located on your module folder, ex: Mycompany/Mymodule/etc/config.xml
<adminhtml>
<cms>
<browser>
<extensions>
<allowed>
<mp4>1</mp4>
</allowed>
<image_allowed>
<mp4>1</mp4>
</image_allowed>
</extensions>
</browser>
</cms>
</adminhtml>
After deploying the module on your Magento folder and clearing your cache, you should be able to upload mp4 videos through WYSIWYG editor.
Then, you can include videos on the CMS Pages like this:
<video width="1280" height="960" controls="controls">
<source src="{{media url="path_of_the_video.mp4"}}" type="video/mp4" />
</video>
I made an example that you can use as a reference:
https://github.com/fontelag/mag_videos_upload

Serve favicon.ico and other static files with VertX

I'm trying to serve a favicon and some fonts.
object Lion : AbstractVerticle() {
#JvmStatic
#Throws(IOException::class)
fun main(args: Array<String>) {
val vertx = Vertx.vertx()
val router = Router.router(vertx)
router.route().handler(CorsHandler.create("*")
.allowedMethod(HttpMethod.GET)
.allowedMethod(HttpMethod.POST)
.allowedMethod(HttpMethod.OPTIONS)
.allowedHeader("X-PINGARUNER")
.allowedHeader("Content-Type"))
// some json GET / POST routes here
router.route().handler(FaviconHandler.create());
router.route().handler(StaticHandler.create())
vertx.createHttpServer().requestHandler { router.accept(it) }.listen(9090)
}
The FaviconHandler throws an exception causing an "Internal Server Error" when I go to http://localhost:9090/favicon.ico
My favicon is located in src/main/resources/webroot/favicon.ico
Oct 22, 2016 11:16:42 PM io.vertx.ext.web.impl.RoutingContextImplBase
SEVERE: Unexpected exception in route
java.lang.RuntimeException: java.lang.NullPointerException
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl.init(FaviconHandlerImpl.java:148)
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl.handle(FaviconHandlerImpl.java:155)
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl.handle(FaviconHandlerImpl.java:33)
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:215)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:78)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:94)
at io.vertx.ext.web.handler.impl.CorsHandlerImpl.handle(CorsHandlerImpl.java:121)
at io.vertx.ext.web.handler.impl.CorsHandlerImpl.handle(CorsHandlerImpl.java:38)
at io.vertx.ext.web.impl.RouteImpl.handleContext(RouteImpl.java:215)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:78)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:94)
at io.vertx.ext.web.impl.RouterImpl.accept(RouterImpl.java:79)
at Lion$main$8.handle(Lion.kt:90)
at Lion$main$8.handle(Lion.kt:43)
at io.vertx.core.http.impl.ServerConnection.handleRequest(ServerConnection.java:286)
at io.vertx.core.http.impl.ServerConnection.processMessage(ServerConnection.java:412)
at io.vertx.core.http.impl.ServerConnection.handleMessage(ServerConnection.java:139)
at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.lambda$createConnAndHandle$1(HttpServerImpl.java:712)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:314)
at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:190)
at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.createConnAndHandle(HttpServerImpl.java:706)
at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.doMessageReceived(HttpServerImpl.java:570)
at io.vertx.core.http.impl.HttpServerImpl$ServerHandler.doMessageReceived(HttpServerImpl.java:522)
at io.vertx.core.http.impl.VertxHttpHandler.channelRead(VertxHttpHandler.java:76)
at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:122)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
at io.vertx.core.http.impl.HttpServerImpl$Http1xOrHttp2Handler.http1(HttpServerImpl.java:1019)
at io.vertx.core.http.impl.HttpServerImpl$Http1xOrHttp2Handler.channelRead(HttpServerImpl.java:990)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:350)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:372)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:358)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:610)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:551)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:465)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:437)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl$Icon.<init>(FaviconHandlerImpl.java:61)
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl$Icon.<init>(FaviconHandlerImpl.java:40)
at io.vertx.ext.web.handler.impl.FaviconHandlerImpl.init(FaviconHandlerImpl.java:143)
... 48 more
Removing the FaviconHandler and normal html, js and css files are serving fine, but fonts are failing to serve.
Failed to decode downloaded font: http://localhost:9090/fonts/glyphicons-halflings-regular.woff
/#/tcr:1 OTS parsing error: incorrect file size in WOFF header
When I go directly to that font-url, the browser is trying to download the font as a regular file.
This seems like a potential solution, but I'm seeing something that is not my favicon, just a 16x16 square with distorted lines in it, the fonts are still trying to download and still giving the error in the browser console.
router.route("/favicon.ico").handler {
it.response().putHeader("Content-Type", "image/x-icon").sendFile("webroot/favicon.ico")
}
router.route("/fonts/glyphicons-halflings-regular.woff").handler {
it.response().putHeader("Content-Type", "application/font-woff").sendFile("webroot/fonts/glyphicons-halflings-regular.woff")
}
So to sum up, how do I make the StaticHandler serve .woff and .ico files correctly with the correct MimeTypes and not have it download those files?
Solution:
First problem I had was that maven shade wasn't copying all the font files into jar for some reason.
Explicitly copying the font files on build and disabling resource filtering for fonts seems to have fixed the font issue.
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>${basedir}/src/main/resources/fonts</directory>
<filtering>false</filtering>
</resource>
</resources>
Then serving the fonts from the resource directory instead of the font directory fixed it (VertX just wouldn't serve from the font directory for some reason even though the files are there)
router.route("/fonts/glyphicons-halflings-regular.woff2").handler {
it.response().sendFile("glyphicons-halflings-regular.woff2")
}
router.route("/fonts/glyphicons-halflings-regular.woff").handler {
it.response().sendFile("glyphicons-halflings-regular.woff")
}
router.route("/fonts/glyphicons-halflings-regular.ttf").handler {
it.response().sendFile("glyphicons-halflings-regular.ttf")
}
router.route().handler(StaticHandler.create().setCachingEnabled(true));
Favicon is probably being cached, still investigating, favicon is not that critical to fix at the moment.
router.route("/favicon.ico").handler(FaviconHandler.create("favicon.ico"))
Favicon.ico:
Simply move your favicon.ico file up a level into the resources folder directly:
/src/main/resources/favicon.ico
Alternatively change your FaviconHandler to pass in the path and filename:
router.route().handler(FaviconHandler.create(FaviconHandler.create("webroot/favicon.ico")))
Your code assumes that FaviconHandler also respects the webroot set in StaticHandler but it does not. That is purely a property of StaticHandler and therefore FaviconHandler looks for the resource in resources/ unless you specify a relative path. When that resource isn't found, it uses the result of getResourceAsStream("favicon.ico") which is null and crashes.
If you look at the unit test for the FaviconHandlerImpl you will see that they place the favicon.ico file in the root of resources instead of webroot.
WOFF Files:
As for your font files you are looking in the wrong place for the problem. It has nothing to do with MIME types.
More likely is that you corrupted the WOFF files on accident. This could have happened when you committed them with GIT and it thought they were text files and it broke the line endings thereby corrupting them. Or you used Maven Filter plugin and it did the same, corrupting them. Or you uploaded/downloaded them via FTP as text files, same problem.
See other posts about this: https://stackoverflow.com/a/33792610/3679676
You don't specify your favicon path, so Vertx tries to locate the default one:
if (path == null) {
icon = new Icon(Utils.readResourceToBuffer("favicon.ico"));
}
Your favicon is located at resources/webroot/favicon.ico, but Vertx looks for it at resources/favicon.ico
So you can either specify FaviconHandler.create("webroot/favicon.ico") or move it one directory up.
Regarding WOFF files, I was unable to reproduce the problem, as WOFF returns with application/x-font-woff, which seems correct.

ImageResizer simply not resizing images

I have an ASP.NET MVC 3 project, and I installed the ImageResizer Mvc Web.Config package, which added all necessary components, and modified my Web.Config file for me.
I have the following code in my MVC View:
<div id="heroimage" class="slideshow">
<div>[LEFT]</div
<div>[RIGHT]</div>
<div>[INDICATOR]</div>
#foreach (ICMSElement oHeroImage in Model.Elements("HeroImage")){
<img src="images/#oHeroImage.Value" />
}
</div>
<div id="image-strip" class="viewer">
<div class="slider">
<ul>
#foreach (ICMSElement oHeroImage in Model.Elements("HeroImage")){
<li><img src="images/#oHeroImage.Value?width=100&height=100"></li>
}
</ul>
</div>
</div>
The images contained in the second div are not being resized. There is no css for the width and height that would be overriding the resizing.
In the troubleshooting page for the ImageResizer, it is stated that if an image cannot be resized, it could be one of the following causes:
You did not register the HttpModule properly in both places of your Web.config file.
(I used the NuGet package that modified the Web.Config for me)
You are using IIS 6 (or earlier), or IIS7 Classic Pipeline, and are not using the .jpg.ashx syntax, and you have not mapped all requests to the ASP.NET runtime.
(My IIS server is running IIS 7 in Integrated mode)
You are using ASP.NET MVC (and have conflicting routes), but do not have the MvcRoutingShim plugin installed.
(The MvcRoutingShim plugin is installed according to the debug page)
You are mistyping the querystring commands.
(I am not doing this in the code snippet above)
The original image is smaller than the size you are requesting, and you are not using &scale=both (The default behavior is to never upscale images, but this can be changed)
(The default image size in this case is 1280x800)
My Resizer.Debug output is here: https://gist.github.com/Thoth2020/11197160
My website is using a base tag in the Layout page, however it is not adjusting the src attribute of the img. For example, the page I am looking at renders this img tag:
<img src="images/00100010_1200_800_slideshow_03.jpg?width=100&height=100">
Which is the same as the snippet above with the Razor syntax interpreted.
So, I guess I am at a loss as to why this is not functioning correctly.
You have an existing controller or another HttpModule that is interfering with ImageResizer. One workaround is to use the fakeExtensions feature to avoid matching those routes. This makes your URLs look like image.jpg.ashx?width=400 instead of image.jpg?width=400.
If your CMS abstracts away image storage, and does not implement VirtualPathProvider, you may need to implement an IVirtualImageProvider to bridge the gap between your CMS data layer and ImageResizer.
Typically, however, you can use one of our existing storage plugins (SqlReader, S3Reader, VirtualFolder, RemoteReader) to access the data store directly instead.
I had the same issue. the imageResizer was saving and showing images just fine but none of the resizing and cropping or rotating functions would work.
My problem solved by simply adding two nuget packages with Install-Package ImageResizer.WebConfig and Install-Package ImageResizer to my web project. I had them on my class library project that was doing all the logic stuff but it seems they are also needed on the running assembly either web app or desktop.

Special character encoding issue on Solaris with weblogic server

I have an application which uses fop and xslt to generate the PDF file. The special characters as §£?ÐÅÆ are appearing as ???? in PDF.
The weblogic server is running on solaris machine.
I have already tried with
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>UTF-8</java-charset-name>
</input-charset>
<charset-mapping>
<iana-charset-name>UTF-8</iana-charset-name>
<java-charset-name>UTF-8</java-charset-name>
</charset-mapping>
</charset-params>
in weblogic.xml.
I have also tried with
transformer.setOutputProperty( OutputKeys.METHOD, "xml");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.setOutputProperty( OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
Nothing seems to be working over there.
Have you set up fop to find fonts with those characters in? For instance, on Solaris 11
using fop (though not with weblogic) I had to set up paths for fonts in a fop-conf.xml:
<?xml version="1.0"?>
<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register all the fonts found in a directory -->
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<!-- directory recursive="true">C:\MyFonts2</directory -->
<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
<renderer mime="application/postscript">
<fonts>
<directory>/usr/share/fonts/X11/Type1/</directory>
<directory>/usr/share/ghostscript/fonts/</directory>
<directory>/usr/share/fonts/TrueType/core/</directory>
<directory>/usr/share/fonts/TrueType/dejavu/</directory>
<directory>/usr/share/fonts/TrueType/liberation/</directory>
<directory>/usr/share/fonts/TrueType/unifont/</directory>
</fonts>
</renderer>
</renderers>
</fop>
(Font paths will be different on older versions of Solaris.)
For more details, see:
http://xmlgraphics.apache.org/fop/trunk/fonts.html
http://www.sagehill.net/docbookxsl/AddFont.html#ConfigFontFop