BigCommerce Stencil: is it possible to get higher quality images from the CDN helper or bypass it everywhere? - bigcommerce

I've noticed that BigCommerce's CDN helper massively reduces the image quality of the images that we pass to it. This is especially problematic on the zoomed-in image on product view pages. I provide a high quality 2000px x 2000px image, and it returns a very pixelated image with the same dimensions. Zooming in on such an image is very off putting and I'd sooner disable zooming that go forward with this.
Has anyone discovered a good work around for this or a way to disable BC's image quality impairment? I thought I had a good workaround that involved ripping out CDN helper references and pointing to images on our own CDN (file names based on SKU), but discovered that this can't be done on the checkout (probably abandoned cart emails too) and doesn't work on images that are inserted by Javascript, for example when one product has two styles (different skus).
I've been customizing the Cornerstone theme in Stencil for my employer for about a month and BigCommerce hasn't been able to provide direction on this issue.

It turned out that we were actually providing a 500px image and asking Stencil to display a 2000px image for the zoomed image, so this result makes sense.

Related

Flatlist not smooth with lot of image per item

I use a flatList to make my activity feed.
However, I have a problem with the fluidity of my list
Each item can render up to 80 static images of 25kb, each in an absolute view, I still have to play with the performance when I mount my components but when I scroll, if I have my 80 images per item, my list is absolutely not fluid!
However, when I check my rendering number, I have very few because I use PureComponent for my items.
I check the RAM, and everything looks good!
My UI and JS Threads are constantly at 60!
Could this be due to the number of views I see in "Perf Monitor" that goes up to more than 3000? If it's that, how do I fix it?
Hoping to have a solution,
Thank you
Viktor
I've been facing the same issue , but after reading docs ive implemented the below :
You can use the community packages (such as react-native-fast-image
from #DylanVann) for more performant images. Every image in your list
is a new Image() instance. The faster it reaches the loaded hook, the
faster your Javascript thread will be free again.
You should always use react-native-fast-image for more images.
Hope it helps. Feel free for doubts
I had issue in my android version. I set resizeMethod="resize". This gave me massive performance boost.
I was loading lot of large images in section list and FlatList. Using resizeMethod as resize resolved my issue, and scroll is buttery smooth after this.

Bootstrap Photo gallery: responsiveness on desktop has bug

Every time the window is sized from big:
http://res.cloudinary.com/liberationfront/image/upload/v1497626018/vb1_t29xlz.png
To small:
https://res.cloudinary.com/liberationfront/image/upload/v1497625905/vb2_gtmjrl.png
There is all of a sudden a gap.
The problem is likely that your images don't all have the exact same aspect ratio, so some of them end up a pixel taller than others in some cases. Then the floated columns don't clear properly.
You can either re-crop your images, which is a fragile solution since you then rely on all future images being perfectly cropped, or you can set your cards' height through CSS and let the images flow to fit. Often using background images gives much more flexibility.
I suggest looking into Bootstrap's responsive embed and setting your images as backgrounds on a child element. Create your own 1:1 class if needed.

How to change aspect ratio of photos taken using AVFoundation?

I am using AVFoundation to take pictures instead of UIImagePicker due to how customizable the user interface presented to the user can be. When using it the aspect ratio that the picture is saved as is the same as the iPhone's video feed. What I want to happen is to have the pictures saved in the same aspect ratio as normal pictures are.
The way that I am currently approaching this is to overlay a black bar in the excess preview display and then just crop the photo after saving it as an image.
However, this feels very crude. I assume that it is a common thing to use the AVFoundation as a way of taking photos and so I assume I must be missing something!
I have used this example code. And I have read through the AVFoundation documentation but can only assume that I am missing a function. I have also read through similar questions to this which describe the process by which I might go about cropping images, but that isn't really my concern.
On the other hand, if there is no standard way to do this, please do let me know so that I can stop worrying that I am approaching it in a convoluted way.
Also, I am using Objective-C so if answers contain code, please could you use the same language?

How to auto generate Retina and Non-retina images from psd

I have a PSD file for my App Interface that was designed for Retina iPhones with a resolution of 640 x 1136. I want to add support for non-retina devices and and add all image assets with both a retina and non-retina version. I find the process of resizing every ui component on photoshop individually very tedious. Does anyone know how I can auto-generate Non-Retina images from the Retina images I have already exported? Thanks
If you have Photoshop CC, you can use Adobe Generator (especially nice when paired with Russell Brown’s free Layer Namer extension). Adobe Generator automatically exports any layers whose names end with .png, and can also export multiple resolutions.
There are also some great posts on this topic by Marc Edwards on the Bjango blog; specifically: Exporting from Photoshop. His articles deal with creating a slice sheet that you export semi-automatically with scripts.
I have used both of these workflows in production. Each has its quirks, but they can both probably be made to do what you’re after.
A tip: I prefer to design at 1x and then scale up. If you design and scale down, you might make an asset an odd number of pixels wide, which could look bad when scaled down. But many graphic designers I've worked with prefer to design at 2x.
For images i am using Resizer .Quite nice and fast application.
If you're able to work from the original .psd then the free SuperExport Photoshop script might be of use. It allows you to export flattened crops (not just entire layers) at multiple resolutions by careful naming of groups and layers. Documentation is here, and an updated version that also supports 3x is here (I'm the author of the - small - 3x modification).
The benefits, as pointed out in the docs, of using the original .psd are that you can see your design in context while selectively (and easily) regenerating assets with a single click.

Vector art on iOS

We've now got 4-resolutions to support and my app needs at least 6 full-screen background images to be pretty. Don't want to break the bank on megabytes of images.
I see guides online about loading PDFs as images and custom SVG libraries but no discussion of prectically.
Here's the question: considering rendering speed and file size, what is the bet way to use vector images in iOS? And in addition, are there any practical caching or other considerations one should make in real world app development?
Something to consider for simple graphics, such as the type of thing used for backgrounds, etc., is just to render them at runtime using CG.
For example, in one of our apps, instead of including the typical repeating background tile image in all the required resolutions, we instead draw it once into a CGPatternRef, then convert it to a UIColor, at which point things become simple.
We still use graphic files for complex things, but for anything that's simple in nature, we just render it at runtime and cache the result, so we get resolution independence without gobs of image files. It's also made maintenance quite a bit easier.