Create image viewer in ajax or flash? - ajax

I've been trying to do more Web development work recently (I currently do other tech stuff, but have some experience with Java, C++, VB, Python, and PHP) and I was asked to create a basic Web site with an image viewer. The site is for an artist and she wants the viewer so users can see thumbnails of her paintings and click them to see a large version.
There are a bunch of existing programs out there (for example, simpleviewer)--most seem to be Flash-based. I want to create my own for various reasons, not least of which is to learn about how to do it. Can anyone give me suggestions/opinions as to what technology to use and how to proceed? Not detailed steps, just pointers in the right direction. (For example, are there existing scripts I could find on the net and then tinker with/modify?) I'm already doing research to figure this out, but advice from savvy programmers will save me some time.
I don't know much about Flash or Ajax, but am willing to learn either (and would eventually like to learn both). I won't be shelling out $700 for Flash Pro right now, so I would need to use something like FlashDevelop if I go that route. Thanks in advance!

You'll want jQuery. jQuery.com
Jquery has tons of useful plugins: jquery plugins page
Start searching! Here's a good one i found searching for "image galley"
Enjoy. Jquery is your friend. Of course this post is biased. So, to give credits to others, you can also look into mootools, YUI, prototype, scriptaculous, etc.

If you are going to go down the flash root definitely look at http://slideshowpro.net/ (you don't need the Flash IDE to customise it - all done via XML settings)
An alternative is via JavaScript. A couple of cool scripts to look at are:
http://jquery.com/demo/thickbox/
http://fancy.klade.lv/

You can scan the images, base64 encode them into a database, then use an < img > tag on your site to point to a PHP page that base64 decodes the images. No real way to watermark them though you could do that before the you load them using GIMP or some similar tool.

Related

Dreamweaver or learn do it from scratch

I would like to create a website (non commercial) for fun. After lot of thought, have decided to go ahead with Rails & Java (in the backend). The main challenge I am facing is with the UI - am not an expert - can work on Html/Css/Javascripts however it would take me much much longer and this is my bottleneck.
I am leaning towards Dreamweaver to build the UI. My question is - will using a tool like Dreamweaver really help me - an armature in UI to create a small web site or am I better off diving deep into CSS/JQuery-UI and then start coding...
In my opinion, drop dreamweaver. You should go look at Bootstrap. It's a very easy to use framework that will assist you in creating your own website from scratch. It's amazingly simple to use and has many jQuery plugins pre-packaged and ready to use.
I second Henry. But if you're new to frontend design; also something to note is the power of tools like chrome inspector to pick it all apart. It's a great way to quickly develop, but also by simply exploring, you'll find yourself learning it all very quickly.. But there's still a lot to learn.
Plus if you're looking into rails, dreamweaver just doesn't fit into the workflow. But then again, I can't imagine dreamweaver fitting into any workflow.

Automatically filling in web query forms and returning data (for a newbie)

I am whatever comes before 'novice' in programming. I have written macros in VBA for Excel, and used Visual Studio a bit when I was younger, but that's about it.
My problem: To produce the reports I need at work, I have to extract data that is stored behind user-friendly query forms on my company's intranet. I have automated every other part of the report except this. I would like to write a program to access this webpage and fill in query forms for me with preset values, and then return the data that is output. I had a discussion with a computer scientist friend of mine who said this was easy to do with Haskell (his language of choice). However I'm no veteran so I'd like to learn a language a bit nearer to my level... Python seems a good bet.
My question: is it possible to do this type of data extraction with Python? How difficult would it be, and what is a good resource to teach myself about it?
I've done some research and come up with Scrapy, but I can't tell whether it fills in forms. Also, if there are other languages more suited to this, I'd be glad to hear it.
The easiest way is just to use urllib2. Usually, arguments to your forms are transferred to the servers so that you can see them in the URL as ?foo=bar&bla=blah. You can generate arguments to your forms with urllib2.urlencode:
Python and urllib2: how to make a GET request with parameters.
For a newbie, you formulate your thoughts very clear, congrats.
I would start by reading some basic tutorials on HTTP. A form is basically just a visual way to collect data. The meat of the form is the request your browser makes with that form data.
So "filling in forms" is really not necessary (it may be though, hopefully its not because it CAN get complicated). What is necessary is learning what request that form actually makes to the browser and emulating it. A super easy way to do this is with chrome developer tools or a firefox extensions called firebug. Each of these provide you with a way to see all network traffic, including forms.
for example if you have a form where you have to submit a data and a report type the actual web request may look like
?date=2012-09-12&type=overview
so basically you would just have to find a way to make a http request to the url with that data. This is a trivial task and pretty much all languages have a way to do this.
It is very possible to do this with python. There is an abundance of tutorials out there. Python has url libraries built into the standard library that can help
http://docs.python.org/library/urllib.html
Everytime I use urllib2 I usually end up at http://www.voidspace.org.uk/python/articles/urllib2.shtml
Combining loginform and scrapy, you can automate filling forms and crawling web pages.
Here's a tutorial on it. http://blog.scrapinghub.com/2012/10/26/filling-login-forms-automatically/

Free web image management

I am looking for free web image management system/script/...
I was using and still use photobucket service, but my account is free and has limited space and bandwidth. Now I am approaching the limits. On another side I have web hosting account and want to use it for image hosting instead or in addition to my photobucket. Sounds good. I can use ftp to upload my images and I am fine with it. What I miss is photobucket's web interface to my images. I am talking about photo galleries or portfolio like or something. But basic list of thumbnails, so I can see my images and easy get link to specific image in different formats to past into forum posts or into other web pages referring to that specific picture. Besides, I need easy way to organize pictures in albums/subalbums (like in file system). I see gazillion of image gallery systems, but have hard time to find for what I need. Oh, and I do not want database, just flatfiles/directories.
Anything come to mind?
There's Coppermine Gallery.
I was just looking for something similar.
I know Coppermine pretty well (I run a site powered by it): it is very flexible, with tons of options, and relatively easy to mod to your needs if you know a bit of php. It also reads and displays EXIF data if you configure it to do so. There is a lively community of developers for Coppermine. There is also a plugin that displays BBcode (http://forum.coppermine-gallery.net/index.php/topic,74043.msg356623.html#msg356623), unfortunately only image by image (not in bulk like the ImageShack Uploader). The drawback is that Coppermine is a pretty bulky script and does not perform super fast, especially on slow servers.
Bravenet seems to be a service more than a script.
I'm also checking out Lightbox 2 (http://lokeshdhakar.com/projects/lightbox2/#example) which seems nice and tiny, but not a chance of getting the EXIF file into the displayed image or getting the BBcode.
Will keep an eye on this thread

Flash type animations but using AJAX?

I am looking for someway to do Flash type movies but with AJAX instead? Flash requires plugins, SEO is difficult and my experience is people tend to stay away from Flash websites unless they are really really good.
Can any provide some insight?
Maybe something like this:
http://activeden.net/item/handdrawn-deeplinking-urban-website/full_screen_preview/40657
You could try and play with the HTML5 canvas tag...
http://flash.digitalmedianet.com/articles/viewarticle.jsp?id=876219
You could use dynamic refreshing of SVG using Javascript, but you will have your work cut out for you.
Javascript, and lots of it, is one option.
Also, sliverlight 3's new navigation model supports deeplinking for SEO, and is really quite powerful for animations
try some of these
http://sixrevisions.com/javascript/10-impressive-javascript-animation-frameworks/
http://hacks.mozilla.org/2009/06/rendering-svg-canvas-burst/
http://raphaeljs.com/
I've been thinking of the same thing, going with javascript rather than flash on some stuff. This works great for small components inside a html website. But to do a whole js site, I'd strongly recommend AGAINST that.
From my experience, the same animation in flash vs javascript... JS is more processor intensive. I don't want to comment on as to which magnitude, but it's noticeable.
Bats also have a funny way of dealing with javascript and ajax content, so don't expect the same result in terms of SEO just because you're not using flash. But because people have used javascript to do content injection/replacement crawlers might be better at searching through the info. There are other ways of dealing with Flash SEO issues. (Gaia framework is not a bad starting point)
Another advantage of not using Flash or Silverlight is that most mobile devices ignore this stuff. However if you're planing on creating a site that acts like flash, the usability across these devices will likely not be consistent.
If you do decide to go this route, it's going to be much like going into a jungle and hacking your way through. Whereas with flash you're likely to be going through a well marked and paved landscape. You can get to the end result either way, but consider how much effort it will take. Flash has internal and community libraries that do all kinds of stuff, with js you'll be writing a lot of your own code and will have beta libraries that might not work well across all browsers.
But on the upside, you'll be a pioneer :)

What are the (technical) pros and cons of Flash vs AJAX/JS?

We provide a web application with a frontend completely developed in Adobe Flash. When we chose Flash 6 years ago, we did so for its large number of features for user interaction, like dragging stuff, opening and closing menus, tree navigation elements, popup dialogs etc.
Today it's obvious that AJAX/JS offers roughly the same possibilities and because of the number of frameworks that are readily available, it's very feasible to implement them.
Is there a technical reason one should choose either technology over the other? By "technical", I mean performance, security, portability/compatibility and the like. I don't mean aspects such as the very non-programmer way development is done in Flash or whether it makes sense to switch an app from one to the other.
As I just explained in another question, it seems to me that JS is way ahead in terms of market share and I'm wondering whether we are missing some important point if we stick to Flash.
In addition to what others have said, Flash is constrained in the "rectangle" and cannot be added to a normal html page in an un-obtrusive manner.
#Gulzar I think when more browsers will support the video tag like mozilla 3.1 does we'll see even more adoption of ajax/js over flash.
Adobe Actionscript is a statically typed language, Javascript is dynamically typed. Depending on your point of view, this may be a good thing or a bad thing.
With Javascript/HTML/CSS you're going to be heading into cross-browser compatibility hell, especially if you want to support older browsers. This can be mitigated by the libraries that are available, but it's still a big headache. With Flash, you write the code once and it just works in all browsers.
Even with the libraries available, Flash user controls are simply more advanced than anything you can find in the world of Javascript/HTML. In Javascript, you are not going to find anything that comes close to the simplicity and power of a databound user control that Flash provides.
I don't see how Javascript has more of a "market share" than Flash. Pretty much anyone with a web browser has a Flash plugin installed. I'd be curious to know how many people disable Javascript but have a Flash plugin.
Also keep in mind that you're going to be in for a huge learning curve and lots of development time if you decide to switch your technology base so you'd really better have a good business reason to do it.
This decision also has a lot to do with what your application does and who your install base is.
Edit: I see people have mentioned that the iPhone doesn't have Flash support. I would expect this to change with the install base of the iPhone - Adobe would be crazy not to support it.
Correctly designed AJAX apps are more googleable than Flash
Correctly designed AJAX apps are more easily deep linkable than Flash
AJAX doesn't require a plugin (Flash is pretty ubiquitous, so it's not really a big deal)*
AJAX isn't controlled by a single company the way Flash is
Edited to add:
* Except for the iPhone, as Abdu points out.
JS and Flash both have great presence on the web with overlapping capabilities. One area JS is still lacking is in rendering video.
Flash, used well, allows easy localization and internationalization.
Furthermore, it is much easier to use Flash in an accessible manner; you can feed screen readers the right text, instead of having them iterate over all of the possible form elements.
I think Flash should be limited to online games, videos and animation. Otherwise use html and Ajax. It's a web standard and supported by almost all devices.
AFAIK, the iPhone doesn't support Flash. That's a fast growing segment you're blocking out already. Keep it simple and efficient.
Although flash is pretty ubiquitous on desktop browsers, mobile support is very limited (flash lite? yeah, right). I get really frustrated looking up a restaurant on my phone only to find the entire site is flash based and I can't even get a phone number or address!
One benefit of Flash is that it has a few facilities to help do cross domain type operations safely, which can be helpful. Flash also has (limited) support for some hardware, which is not possible with Javascript.
Personally, I'd try to use as much Ajax as possible before turning to something like Flash. From the UI perspective, it is better in that the controls and basic authoring is a little more developed. The Sound Manager project is a good example of effectively using a small amount of Flash while keeping the remainder in Javascript.
I suspect one of the reasons javascript is becoming more popular is that it's more easy to retrofit into an existing application.
As I can't accept two answers, I'm going to merge Christ Upchurch's and 17 of 26's answers in my own post. I think, these two together pretty much sum up what I wanted to know. Thanks guys!
If you're dealing a lot with polygons, then Flash is still easier to program and debug. With AJAX there are a lot of libraries to handle polygons, but the more libraries your app uses, the slower it gets.

Resources