Reduce image size of multiple images via ssh - ssh

I have an e-commerce website I made for a client.
As with any e-commerce site, there are a lot of pictures.
About a hundred of these pictures were uploaded by me, provided by my client.
The other 400 were uploaded by client.
The problem is that the first set of images that my client provided me with were about 100kb each, which is not such a big deal. The second set of images, the ones my client uploaded, were about 5-9 MBs in size. Obviously I didn't see this until it was too late.
So my question is this: How can I reduce the image size of all those load-heavy images to something more around 100-200kb through ssh/commandline/php.
I'm also talking about re-scaling the images to something smaller (currently they are about 3700px x 5600px).
Please note: I don't need a solution to re-scale the images when they are being uploaded.
I need a solution to re-scale the images that are already on the server.

Assuming your server is a Unix, you can use imagemagick/convert tool:
http://doc.ubuntu-fr.org/imagemagick
You can also use PHP+GD, see:
http://fr.php.net/manual/en/book.image.php

Related

Is saving thumbnail preview as base64 in the local DB a good idea?

I'm new to RN and I want to create something similar to the phone's native photo app. I'm developing a grid preview of all of a user's photos in a Flatlist. We're talking tens of thousands of photos. I'm saving the user's photo information in a local DB and was wondering if saving the thumbnail as base64 to boost performance is a good idea or not. What would be the standard practice in this scenario?
Edit: I'm using Expo's MediaLibrary.getAssetsAsync() with pagination, it's not very performant. If I only request a few dozen photos it loads fast but you need more loads as you scroll your photos, if I load many at once, I can scroll faster but I have wait longer for each load. I even tried a quick load with a second larger load to trick the user into a feel of smooth scrolling. Wouldn't storing the results in a local DB make things much faster?
Data is currently stored locally, adding a local database here is i think useless and adds complexity to your architecture
If you're building a rich-content app and get picture from the net, you can opt for cache and thumbnail solution
After all depends on how you want to present your application, if a preview of the image is sufficient before loading the large format image.
For my part I would prefer the cache and the thumbnail only when information passes through the internet, in the case of local data I set up a progressive loading of the images by detecting the images of the area to be loaded otherwise no need to load the others .

Is there a way to edit the size of on image on Cloudinary without changing the url?

I am optimizing a small website with images hosted on Cloudinary.
I would like to reduce all the file sizes of the images in one go without editing the URLs on the website.
Can this be done?
You'll have to reupload the images while performing incoming transformations, where the transformations are applied upon upload rather than on the fly.

The best way to manage images when importing from csv in prestashop

I want to know the best way how to handle/manage our products images when we import products from csv in Prestashop 1.6. I mean, does Prestashop provide place/space to upload many images? or we must upload in external website (what website)?
May be this question is general enough, but when I googling I dont get the clear answer. Your answers I appreciate.
Newer PrestaShop versions support new storage architecture for pictures. This new system of image placement allows to work with images much faster, keeping them in order. Images are stored at /img/p folder, in created subfolders that correspond to image ID
Basically, you will avoid having 100,000 pictures in the same “/img/p” folder. Instead, the pictures will be placed into subfolders within “/img/p” directory (e.g.: “/img/p/1/2/ for image with ID 12 or /img/p/7/6/5/4/7 for image with ID 76547).

coldfusion MSFT SQL Image Store

I am using ColdFusion 10 and working on new project where the user will be allowed to upload pictures from events. Never worked with user uploaded images before. How do I store the image in MSFT SQL? Is there a best practice when it comes to users uploading huge 10 MEG pictures? Is there a way to control or automatically compress pictures?
Thanks!
This is a two part question:
Part 1:
First part will be your data store and pull. Where you will use in your cfquery, cfqueryparam that will look like this:
INSERT into EMPLOYEES (FirstName,LastName,Photo)
VALUES ('Aiden','Quinn',<cfqueryparam value="#ImageGetBlob(myImage)#" cfsqltype='cf_sql_blob'>)
To select then reconstruct you will use this:
<cfset myImage = ImageNew(#GetBLOBs.PHOTO#)>
Where you can then do this:
<img src='#myImage#>
Above examples pulled from the docs.
Get familiar with <cfimage> and cfscript version image() for editing (rotating, scaling, etc.)
Part 2:
The other part to your question has to do with upload limits.
Coldfuion has limits that can be changed in CFIDE or RAILO equivalent. There is also limiters set in your web service like apache and IIS, you will have to look into this to change it.
BUT if you are only concerned about 10 mb size images you will be fine. It is when you get into hundreds of MB size files that will cause you headaches.
Remember on your form to set your form enctype to this because you will have to upload your file to your server before you can work with it:
<form action="workPage.cfm" method="post" enctype="multipart/form-data">
Also you will have to access that file using <cffile>
I think all this is enough to get you started.
If you are concerned about the storage size of an image, and this is of course a reasonable concern, then you could use to scale the image down to the maximum dimensions and quality or compression level (if stored as a jpeg) that you need within your application.
Storing your images within a database allows them to be more easily portable, across a cluster for instance. If that is not a concern, then what I tend to do is generate a unique name for each image uploaded, rename them, and store the unique name in the database rather than the image itself.

Download large amount of images with objective-C

I'm currently developing an order entry application for my company. This means I need to download approximately 1900 product images to the iPad, and that's just the normal images. I also need to download an equal amount of thumbnails. The reason for downloading the images to the iPad instead of just displaying them from a given URL is that our reps wander into large stores which often don't have stable internet connections.
What would be the best course of action? The images are stored on our servers, but you need to be authenticated using Basic Auth before you can access those. I have thought of just downloading them one-by-one, which is tedious, or group them together on the server as a zip-file but that would be a large file.
A one-by-one is a valid options for the download. I have done projects with similar specs, so what I advise:
Use some 3rd party library to help you with the download of the images. MKNetworkKit for example. If you feel confortable enough, NSURLConnection is more than enough.
Store the images in the application sandbox.
Instead of downloading the thumbs, just create them on the go when you need them (Lazy pattern). Unless your image's thumbs are somewhat different than the original (some special effect).