I use ngx_http_image_filter_module module for serving images in my project.
Everything works perfectly. And now I want to dynamically put watermarks on images.
I can't put them on upload because image sizes are often being changed.
So, is that possible with nginx?
Try this patch. I found it through internet.
It is allow to nginx to apply watermark's. This implementation only works with using function, which change size of image.
Related
I am using nginx with uwsgi.
I want to serve an html page but with an image attached to it dynamically. So the page will have some contents (generated dynamically) and the image at the top.
Please let me know how can I do it.
I am able to serve the page with contents alone.
Note: I am not using anything else (like Flask, Django etc.).
Thanks a lot.
I use Nginx and I have installed Google PageSpeedModule on one of my domain. This module is really usefull, and easy to use. All CSS and JS are minified, my images are compressed... it has reduced the weight of 500 kb of my pages.
My question is, can I use this module to deliver only ressources ? I create a kind of CDN, containing all my CSS, images, JS... But, I installed Nginx + pagespeedmodule and the module is not working for one image only for example. But it works with an HTML page and compress the images in this page, but can it work with a direct access image ? Thanks.
Yes, you can use InPlaceResourceOptimization to optimize images even if they are not optimized in HTML (Note: That doc says that this is an Apache-only feature, but that's out of date, it works in the latest Nginx as well.). Add this command to your config:
pagespeed InPlaceResourceOptimization on;
Note that the default way that ngx_pagespeed works is by rewriting resources found in HTML. That is the most efficient way to run it. If you only use InPlaceResourceOptimization you will not get some advantages like cache extension and image resizing. However this is a convenient feature if you cannot optimize resources in HTML.
Here is my simple (I hope) problem:
I 'm running a web app with eclipse through tomcat 7. I use the classic servlet-model-jsp pattern. My problem is when I change something in the stylesheet (CSS) and restart tomcat and reload the page on the chrome, the new css is not loaded on the browser (I check it through the browser and i see the same as before the changes).
What is wrong and what can i do about it?!
Thank you in advance :)
I don't think this is a client issue. I think it is a bug in Eclipse/ Tomcat plugin. If you check the request.getPathTranslated() inside the servelet doGet method, it will be something like
C:\Users\YourName\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\
wtpwebapps\yourAppName\
So the tomcat running inside eclipse is serving up static content from there, which is different to the location of static content that you are editing, which is usually something like
C:\fullPathTo\yourAppName\src\main\webapp\static
Tomcat inside eclipse often neglects to update the static content from where you have edited it to the plugins... spot from where it serves it to your web page.
To solve the problem I use Beyond Compare or similar, and set up a compare between the directories
C:\fullPathTo\yourAppName\src\main\webapp\static
and
...\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\yourAppName\static
If css or other static changes (such as javascript files) fail to show up in the browser, just do a quick refresh of the Beyond Compare window, this will highlight the mismatches, copy them across manually, and you are good to go.
I know this is a hack but it works for me, till the eclipse guys get this sorted out.
I am developing a drop-in component for our company's websites. This component allows users to send messages to each other.
Making this, I've hit several problems during development, such as LoadControl() not working (as it seems to be relative to the project including the module, not the module itself).
I managed to fix this using an approach I found online, but now the next problem emerges - images.
To make the component look somewhat nice, images would be appreciated by the users for icons.
But, again, I am stuck at the same problem.
For instance, if I want an ImageButton, I would set it's ImageUrl property to "~/images/message.png", but this really references something inside my DLL and as such obviously doesn't work!
Is there a standard, good solution for this kind of problem?
Thanks!
You could use WebResources, look at
http://www.aspcode.net/Including-WebResource-in-ASPNET-server-control.aspx
or embedd image in control assembly as resource and serve it with http module, but you will have to declare that http module in web config of application that is using your control.
hai,
i am getting the images in my localhost.But when i am uploading my project the images are not displayed.
I am saving my images in "~/App_Themes/darkOrange/images/button_line.jpg".
Is their is another method for giving image path in ASP.Net.
please help.
thank you.
Yes - check what is actually getting rendered out in the "src" attribute for the images. See if you can physically get to that file, if you cant, means the webpage cant. Have you confirmed the images have been deployed to the web server (not local - the server you uploaded to).
If not, make sure the "Build Action" for the images are set to "Content" in the properties window in Solution Explorer.
I faced a similar problem once. But, that was just a static website. Where the images were displayed in localhost but when I ftp files to the server, the images wouldn't show.
Later, I found out that it was becasue of the different case. For e.g - The image file name was "Image.JPG" and I had used "Image.jpg" in my code
Just check if this helps.