BenjaminBrandmeier / angular2-image-gallery

Image Gallery built with Angular 17+, node.js and GraphicsMagick

Home Page:https://oidamo.de/blog/gallery-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unwanted image rotation

shanieMoonlight opened this issue · comments

Hi,

I'm using your angular2-image-gallery and find it very useful.
I'm having one problem though. All my portrait oriented images are being shown in landscape format.
I've checked the underlying files and they are in portrait orientation.

Is there a setting I'm leaving out?

Thanks
Shane

I'm also facing the same problem!
I think problem is that photos are actually saved in landscape format, but your camera saves exif data and because of that most viewers automatically rotate it. Browser does not rotate them though. So extra check for exif tag orientation is needed in the code of the gallery.

Added some temporal resolution that works for me. 'orientation' property has to be added to json.
It can be found in the forked https://github.com/v-bodnar/angular2-image-gallery
Commit 571099c

@v-bodnar
I got the latest master branch of your angular2-image-gallery and got the following error

core.js:1440 ERROR TypeError: Cannot read property 'cameraModel' of undefined
    at GalleryComponent.parseExifData (gallery.component.ts:143)
    at Object.eval [as updateRenderer] (GalleryComponent.ngfactory.js:21)
    at Object.updateRenderer (core.js:14279)
    at checkAndUpdateView (core.js:13800)
    at callViewAction (core.js:14146)
    at execEmbeddedViewsAction (core.js:14104)
    at checkAndUpdateView (core.js:13796)
    at callViewAction (core.js:14146)
    at execEmbeddedViewsAction (core.js:14104)
    at checkAndUpdateView (core.js:13796)

exifData seems to be undefined ?

@IIvanov8888
Thanks fixed it in the commit 7a06e34
But if you just need orientation check out 571099c later I have added few libraries and some code for my private project

thanks @v-bodnar , I got the latest version , but it seems like there is one more issue with jquery

core.js:1440 ERROR ReferenceError: $ is not defined
    at SafeSubscriber.eval [as _next] (gallery.component.ts:98)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:239)
    at SafeSubscriber.next (Subscriber.js:186)
    at Subscriber._next (Subscriber.js:127)
    at Subscriber.next (Subscriber.js:91)
    at MapSubscriber._next (map.js:85)
    at MapSubscriber.Subscriber.next (Subscriber.js:91)
    at FilterSubscriber._next (filter.js:90)
    at FilterSubscriber.Subscriber.next (Subscriber.js:91)
    at MergeMapSubscriber.notifyNext (mergeMap.js:151)

Do you happen to see the thumbnails broken when displaying the images ? I need to zoom in and out to have them properly displayed.
screen shot 2018-01-24 at 22 13 28

About jquery, try to run npm install jquery
As I have mentioned previously, I have added a lot of stuff in later commits (jquery, bootstrap, fontawesome, added some pipes), consider using version from 571099c

@IIvanov8888
About problem with broken thumbnails, images are downloaded as you scroll down, there is a function that detects scrolling position and calculates if you have reached particular image. May be you are using gallery in a container with overflow: hidden, or there is some error calculating thumbnails size... Actually I didn't face such behavior.

@v-bodnar thanks , I had mat-card as wrapper of the gallery , that seems to be an issue with the thumbnails.
I added all the additional libraries , but I now facing the following error =>

$(...).popover is not a function

I used a different approach via graphicsmagick to solve this. The fix will the issue for all images containing EXIF orientation information. Will be included in the next published version. Publishing the next version might take a while.

If you need the fix now just grab the convert script from this repository.