Questions About Picturefiles

Android custom camera photos not shown in gallery

I'm creating custom android camera layout.

I've used information from http://developer.android.com/guide/topics/media/camera.html#basics. Everithing works fine except one thing.

The photo is not shown in the phone's gallery. The metod is:

private Camera.PictureCallback cameraCallback = new Camera.PictureCallback() {

    @Override
    public void onPictureTaken(byte[] data, Camera camera) {

        File pictureFile = getOutputMediaFile();
        if (pictureFile == null){
            Log.d(Values.APPLICATION_TAG + ACTIVITY_TAG, "Error creating media file, check storage permissions: ");
            return;
        }

        try {
            FileOutputStream fos = new FileOutputStream(pictureFile);
            fos.write(data);
            fos.flush();
            fos.close();
            createPhotoAndShowPreview(Uri.fromFile(pictureFile));
        } catch
    
http://www.stackoverflow.com/questions/14082326/android-custom-camera-photos-not-shown-in-gallery

How to deliver different Responsive Images?

On this website:

  • .php

  • .jquery

  • .yii based

We need to have two or more different infographic pictures, depending on the viewport width.

  • The client is picky about w3c validation

  • picturefill solution doesn't validate

  • different images and not only different image version, should be served

  • for a lot of reasons background images are not a solution*

  • IE8 and up support

I can use either a server or client side version, no problem.

Reasons:

  1. Background image technique does work, but those infographics are NOT background.

  2. They should arrive server side.

  3. Obviously, they need to adapt. (and background size... well...)

  4. Even worst, we do have responsive tooltips image maps associated with those info

http://www.stackoverflow.com/questions/12760650/how-to-deliver-different-responsive-images

Overwrite data and setData in Qt's QFileSystemModel

What I'am trying to do: Overwrite QFileSystemModel's setData and data to implement Caching of pictures in the shown directory.

I use a QListView for testing purpose.

Here is the relevant code:

My Class with QFileSystemModel as parent:

.h-file:

#ifndef QPICSINFILESYSTEMMODEL_H
#define QPICSINFILESYSTEMMODEL_H

#include <QFileSystemModel>
#include <QCache>
#include <QDebug>

/* This Model holds all Picturefiles with a cached QPixmap of
 * them.
 */

class PicsInFileSystemModel : public QFileSystemModel
{
public:
    PicsInFileSystemModel();
    QVariant data (const QModelIndex & index, int role);
private:
    QCache<qint64,QPixmap> *cache; //Cache for the pictures

};

#endif // QPICSINFILESYSTEMMODEL_

.cpp-file:

#include "PicsInFileSystemModel.h"

PicsInFileSystemModel::PicsInFileSystemModel()
{
    QStringList myFilter;
    this->setFilter(QDir::Files | QDir::AllDirs);
 
    
http://stackoverflow.com/questions/2305685/overwrite-data-and-setdata-in-qt-s-qfilesystemmodel