ImageView+ 1.2 - Enhanced image viewer


ElDoRado1239

Recommended Posts

I tried it, doesn't seem very good to me:

1. Your userscript doesn't have Greasemonkey-native functions, so it should be very easy to convert to a Maxthon extension

2. It shouldn't fit images smaller than the screen

3. Zooming is broken by design, you can only zoom into the center and from the center, so if you move the image around you'll be back in the middle when you scroll

4. If you click the image a few times it can start appearing anywhere on the screen

5. It has the same problem as the default viewer: scrolling to the left or right (you can do that on some mice) does the same as scrolling up and down

6. You shouldn't rely on the correct file extension to start the script and instead should check if "imgView" variable is defined

Link to comment
Share on other sites

Thanks for feedback!

1. I am indeed thinking about it. But I have yet to learn how to make extensions. It's on the list though.

2. It does that by desing, actually that's why I made it in the first place. If I ever make it into an extension, I'll let you choose.

3. Working on it, zoom will use the position of the mouse on the picture as the center for scaling.

4. That's already sorted out, next update won't do this. It had something to do with Maxthon itself and what it does with the picture before I can touch it.

5. I have a standart mouse without sidescrolling, never noticed. I will look into it.

6. Thanks for the "imgView", I didn't know! Right now, I check the extension so it wouldn't fire on all pages and then I check the page title, which is always "name.extension (widthxheight)".

The main function right now is the auto-fitting. Zoom is kinda awkward, I know - but I will soon post a new version with a few improvements I have in mind.

Link to comment
Share on other sites

Thank you again for your help!

I have finished the Maxthon extension and everything should be fixed now. I sent it to Maxthon Extension Center for approval and I will update this post once they reply.

Edit: Well I'm having some trouble with uploading this extension to the Extension Center. Until I sort it out, I'll just leave the file attached to my first post. (EC's reject reason says 'file not found', which makes no sense...)

Link to comment
Share on other sites

Extension is 172 kilobytes, 165 of which is from an SVG file that consists of a rectangle and a 1280x863 PNG image of an eye

The extension icon must have _16, _32, and _48 resolutions

JSON is badly formatted:

>'svg_icon' : 'eye.svg',

>'title' : { '_t' : 'imgviewplus' },

The script itself:

>Line 53: Uncaught SyntaxError: Unexpected token ;if(nw>=getw()){seth(wh);setw(Math.floor(wh*(nw/nh));x=(ww-getw())/2;y=0;}Enhance:if

(

nw>=getw()

)

{

seth(

wh

);

setw(

Math.floor

(

wh*

(

nw/nh

)

)

// There should be a ")" symbol to close "setw" function

;

x=

(

ww-getw()

)

/2;

y=0;

}This same error repeats for lines 54 and 55

>Line 54: Uncaught ReferenceError: getnh is not defined

Possibly a typo of geth()

After fixing all of these errors it sort of works, image appears at the top-left corner for some reason and zoom is broken. And you can move the image out of the boundaries of the window (especially when the window is resized)

Link to comment
Share on other sites

Ok, it should be fixed. Too bad the Extension Center didn't just say something like "syntax errors" or whatnot... I have packaged in a bad version of the code by accident. This was supposed to make the code more compact, but it's not finished. Luckily I had the original code as well.

The SVG icon is now gone, I should have noticed the filesize is made mostly of this icon.

Thanks again for your help!

Link to comment
Share on other sites

Nice work, there are things that could be improved but it looks very good so far

For example, try playing with mousewheel when your mouse is outside of the picture

Resizing the window resets the zoom (you could make it so it still brings the picture to the middle but keep the zoom)

Darker background like in Firefox

Checkerboard pattern for transparent PNGs and GIFs

And here's what I'd like to see: some sort of heads-up interface at the bottom that would have buttons like rotate and 100% size, along with zoom slider

Link to comment
Share on other sites

ElDoRado1239 replied at 2014-11-18 07:41 back.gif

Ok, it should be fixed. Too bad the Extension Center didn't just say something like "syntax errors" ...

Works well.

Too bad the Extension Center didn't just say something like "syntax errors" or whatnot.I've been at them about this. It seems extensions are actually looked at by someone, so I can't see why they elaborate a little more. Makes it easier for everyone involved.

Link to comment
Share on other sites

What exactly do you have in mind? I have already incorporated a few of those things into the extension - zooming when outside the picture (acts like as if you were pointing at the edge of the image if you scroll outside of it), background... working on the menu right now.

From the menu, you will have more zooming options (slider,fit to window, original size...), you will be able to rotate and flip the image, resize it, cut and crop, change a few color options, search for similar images with Google (which already works) and do a few special effects (some quick and simple stuff, ie. a sepia filter).

Plus there is a Settings button, where you will be able to set the default zoom, background color etc.

post-2065060-14315122297322_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Hello again.

I discovered the other day that your extension seems to break image displays in my online RSS reader (www.commafeed.com).

Is there any possibility of your adding maybe a whitelist/blacklist option?

Another thing I noticed is that zooming with the mousewheel seems quite loose, so that the zoom will continue for longer than the wheel is moved. Is there any chance of an option to disable this, or at least tighten it up a bit?

Sorry if I'm being picky : )

Link to comment
Share on other sites

  • 2 weeks later...

Ok I'm back with some news. The new version is almost done - I have added these features: image rotation (in 90° steps), horizontal/vertical flip, cropping an area that shows up in a new tab as a new image, google image search.

Right now, I am finishing a few things and by the end of the weekend, the new version should be ready.

Next version should add some sort of a Settings screen, so I can add a few basic things for you to customize. White/blacklisting is a great idea, I guess it could get annoying having to turn the whole extension off when needed...

As always, thanks for support and ideas. :)

post-2065060-14315122633932_thumb.jpg

Link to comment
Share on other sites

  • 2 weeks later...

Well, the thing is - I haven't yet created any config screen. But that certainly will be a part of the next update.

Once I have an actual place to set and save some preferences, there will be an option not to enlarge smaller images for sure. You're not the only one mentioning it, so I guess people would like that.

Link to comment
Share on other sites

  • 1 year later...